diff --git a/implementations/Crafter.Build-Configuration.cpp b/implementations/Crafter.Build-Configuration.cpp index f748918..e8fd67d 100644 --- a/implementations/Crafter.Build-Configuration.cpp +++ b/implementations/Crafter.Build-Configuration.cpp @@ -60,13 +60,7 @@ namespace Crafter { if(config.contains("standard")) { standard = config["standard"].get(); } else { - #ifdef CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_linux_gnu standard = "c++26"; - #endif - #if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32) - standard = "c++latest"; - #endif - } if(config.contains("target")) { target = config["target"].get(); } else { diff --git a/implementations/Crafter.Build-Project.cpp b/implementations/Crafter.Build-Project.cpp index 43ded3a..362c0cd 100644 --- a/implementations/Crafter.Build-Project.cpp +++ b/implementations/Crafter.Build-Project.cpp @@ -245,7 +245,13 @@ namespace Crafter { std::string editedTarget = config.target; std::replace(editedTarget.begin(), editedTarget.end(), '-', '_'); + + #ifdef CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_linux_gnu std::string command = std::format("clang++ -stdlib=libc++ --target={} -march={} -mtune={} -std={} -D CRAFTER_BUILD_CONFIGURATION_TARGET_{} -fprebuilt-module-path={}", config.target, config.march, config.march, config.standard, editedTarget, (exeDir/config.target).string()); + #endif + #if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32) + std::string command = std::format("clang++ -nostdinc++ -nostdlib++ -isystem %LIBCXX_DIR%\\include\\c++\\v1 --target={} -march={} -mtune={} -std={} -D CRAFTER_BUILD_CONFIGURATION_TARGET_{} -fprebuilt-module-path={}", config.target, config.march, config.march, config.standard, editedTarget, (exeDir/config.target).string()); + #endif for (const auto& entry : fs::recursive_directory_iterator(buildDir)) { if (entry.is_directory() && entry.path().filename() == "include") { @@ -450,14 +456,22 @@ namespace Crafter { if(config.target == "wasm32-wasi") { outputName += ".wasm"; } + + + #ifdef CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_linux_gnu buildResult.errors = RunClang(std::format("{}{} -o {} -fuse-ld=lld ", command, files, (binDir/outputName).string())); + #endif + + #if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32) + system("copy %LIBCXX_DIR%\\lib\\c++.dll \bin\executable-windows-msvc\\c++.dll"); + uildResult.errors = RunClang(std::format("{}{} -o {} -fuse-ld=lld -L %LIBCXX_DIR%\\lib -lc++ %useLibcCommon% -nostdinc++ -nostdlib++", command, files, (binDir/outputName).string())); + #endif } else if(config.type == CRAFTER_CONFIGURATION_TYPE_LIBRARY) { #ifdef CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_linux_gnu RunClang(std::format("ar r {}.a {}", (binDir/fs::path(std::string("lib")+outputName)).string(), files)); #endif #if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32) - system("copy %LIBCXX_DIR%\\lib\\c++.dll \bin\executable-windows-msvc\\c++.dll"); RunClang(std::format("clang-lib.exe {} /OUT:{}.lib", files, (binDir/fs::path(outputName)).string())); #endif } else {