windows build fixes
Some checks failed
demo.yaml / windows build fixes (push) Failing after 0s

This commit is contained in:
Jorijn van der Graaf 2026-03-01 17:27:45 +01:00
commit 43d59e2f57
3 changed files with 8 additions and 31 deletions

View file

@ -148,22 +148,19 @@ namespace Crafter {
std::string msvcVersion = folders.front();
clDir = std::format("{}\\MSVC\\{}\\bin\\Hostx64\\x64", directoryPath, msvcVersion);
clangClDir = std::format("{}\\Llvm\\x64\\bin", directoryPath);
std::string sourceFilePath = directoryPath + "\\MSVC\\" + msvcVersion + "\\modules\\std.ixx";
std::println("Auto-Detected:\nCL: {}Clang: {}\nstd.ixx: {}", clDir, clangClDir, sourceFilePath);
if(!fs::exists(stdPcm) || fs::last_write_time(stdPcm) < fs::last_write_time(sourceFilePath)) {
fs::copy(sourceFilePath, stdcppm, fs::copy_options::overwrite_existing);
std::string result = RunCommand(std::format("cd {}\\{} && \"{}\\clang-cl.exe\" /EHsc /MD /std:c++latest --target=x86_64-pc-windows-msvc -Wno-include-angled-in-module-purview -Wno-reserved-identifier -Wno-reserved-module-identifier --precompile std.cppm -o std.pcm", exeDir.string(), config.target, clangClDir, stdPcm));
std::string result = RunCommand(std::format("cd {}\\{} && \"{} clang-cl.exe /EHsc /MD /std:c++latest --target=x86_64-pc-windows-msvc -Wno-include-angled-in-module-purview -Wno-reserved-identifier -Wno-reserved-module-identifier --precompile std.cppm -o std.pcm", exeDir.string(), config.target, clangClDir, stdPcm));
if(result != "") {
std::cout << result << std::endl;
throw std::runtime_error(result);
}
result = RunCommand(std::format("cd {}\\{} && \"{}\\cl.exe\" /std:c++latest /EHsc /nologo /W4 /MD /c \"{}\"", exeDir.string(), config.target, clDir, sourceFilePath));
std::cout << std::format("cd {}\\{} && \"{}\\cl.exe\" /std:c++latest /EHsc /nologo /W4 /MD /c \"{}\"", exeDir.string(), config.target, clDir, sourceFilePath) << std::endl;
result = RunCommand(std::format("cd {}\\{} && {} cl.exe /std:c++latest /EHsc /nologo /W4 /MD /c \"{}\"", exeDir.string(), config.target, clDir, sourceFilePath));
std::cout << std::format("cd {}\\{} && {} cl.exe /std:c++latest /EHsc /nologo /W4 /MD /c \"{}\"", exeDir.string(), config.target, clDir, sourceFilePath) << std::endl;
std::cout << result << std::endl;
std::cout << "hello?" << std::endl;
}
@ -174,26 +171,7 @@ namespace Crafter {
directoryPath.pop_back();
directoryPath += "\\VC\\Tools";
std::vector<std::string> folders;
// Iterate through the directory and collect all subdirectories
for (const auto& entry : fs::directory_iterator(directoryPath+"\\MSVC")) {
if (entry.is_directory()) {
folders.push_back(entry.path().filename().string());
}
}
// Sort the folders by version in descending order
std::sort(folders.begin(), folders.end(), [](const std::string& a, const std::string& b) {
return std::lexicographical_compare(b.begin(), b.end(), a.begin(), a.end());
});
std::string msvcVersion = folders.front();
clDir = std::format("{}\\MSVC\\{}\\bin\\Hostx64\\x64", directoryPath, msvcVersion);
clangClDir = std::format("{}\\Llvm\\x64\\bin", directoryPath);
vsVars = std::format("\"{}\\VC\\Auxiliary\\Build\\vcvars64.bat\"", directoryPath);
}
#else