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 16:48:43 +01:00
commit 275dbd0ff3

View file

@ -121,25 +121,17 @@ namespace Crafter {
}
void BuildMsvcStdPcm(const Project& project, const Configuration& config) {
std::cout << "bruh 1" << std::endl;
fs::path exeDir = GetPath();
std::cout << "bruh 2" << std::endl;
fs::create_directories(exeDir/config.target);
std::cout << "bruh 3" << std::endl;
std::string stdPcm = std::format("{}\\{}\\std.pcm", exeDir.string(), config.target);
std::string stdcppm = std::format("{}\\{}\\std.cppm", exeDir.string(), config.target);
std::cout << stdPcm << std::endl;
std::cout << stdcppm << std::endl;
std::string directoryPath = RunCommand("\"C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe\" -latest -property installationPath");
directoryPath.pop_back();
directoryPath += "\\VC\\Tools";
std::cout << directoryPath << std::endl;
std::vector<std::string> folders;
// Iterate through the directory and collect all subdirectories
@ -149,19 +141,13 @@ namespace Crafter {
}
}
std::cout << "bruh 4" << std::endl;
// 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::cout << "bruh 5" << std::endl;
std::string msvcVersion = folders.front();
std::cout << msvcVersion << std::endl;
clDir = std::format("{}\\MSVC\\{}\\bin\\Hostx64\\x64", directoryPath, msvcVersion);
clangClDir = std::format("{}\\Llvm\\x64\\bin", directoryPath);
@ -171,11 +157,13 @@ namespace Crafter {
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-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-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));
result = RunCommand(std::format("cd {}\\{} && \"{}\\cl.exe\" /std:c++latest /EHsc /nologo /W4 /MD /c {}", exeDir.string(), config.target, clDir, sourceFilePath));
std::cout << result << std::endl;
}
}
@ -186,8 +174,6 @@ namespace Crafter {
directoryPath += "\\VC\\Tools";
std::cout << directoryPath << std::endl;
std::vector<std::string> folders;
// Iterate through the directory and collect all subdirectories
@ -197,19 +183,13 @@ namespace Crafter {
}
}
std::cout << "bruh 4" << std::endl;
// 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::cout << "bruh 5" << std::endl;
std::string msvcVersion = folders.front();
std::cout << msvcVersion << std::endl;
clDir = std::format("{}\\MSVC\\{}\\bin\\Hostx64\\x64", directoryPath, msvcVersion);
clangClDir = std::format("{}\\Llvm\\x64\\bin", directoryPath);
}
@ -335,9 +315,6 @@ namespace Crafter {
// }
void BuildStdPcm(const Project& project, const Configuration& config) {
std::cout << "bruh" << std::endl;
std::cout << config.target << std::endl;
std::cout << "bruh2" << std::endl;
if(config.target == "x86_64-pc-linux-gnu") {
BuildGnuStdPcm(project, config);
} else if(config.target == "x86_64-w64-mingw32") {