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

This commit is contained in:
Jorijn van der Graaf 2026-03-01 20:24:35 +01:00
commit 2c6a7cb857
4 changed files with 13 additions and 2 deletions

View file

@ -74,7 +74,6 @@ namespace Crafter {
target = RunCommand("clang -print-target-triple"); target = RunCommand("clang -print-target-triple");
#endif #endif
#if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32) #if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32)
AutoDetect();
target = "x86_64-pc-windows-msvc"; target = "x86_64-pc-windows-msvc";
//target = RunCommand(std::format("{} && clang-cl.exe -print-target-triple", vsVars)); //target = RunCommand(std::format("{} && clang-cl.exe -print-target-triple", vsVars));
#endif #endif

View file

@ -240,7 +240,9 @@ namespace Crafter {
fs::path exeDir = GetPath(); fs::path exeDir = GetPath();
std::cout << "before pcm" << std::endl;
BuildStdPcm(*this, config); BuildStdPcm(*this, config);
std::cout << "after pcm" << std::endl;
std::string editedTarget = config.target; std::string editedTarget = config.target;
std::replace(editedTarget.begin(), editedTarget.end(), '-', '_'); std::replace(editedTarget.begin(), editedTarget.end(), '-', '_');
@ -331,6 +333,8 @@ namespace Crafter {
std::vector<std::string> resultsDep(config.dependencies.size()); std::vector<std::string> resultsDep(config.dependencies.size());
std::cout << "bruh 5" << std::endl;
for(std::uint_fast32_t i = 0; i < depThreads.size(); i++) { for(std::uint_fast32_t i = 0; i < depThreads.size(); i++) {
depThreads[i] = std::thread([i, &config, &libMutex, &depLibSet, &buildDir, &pcmDir, &libsString, &binDir, this, &buildResult, &resultsDep](){ depThreads[i] = std::thread([i, &config, &libMutex, &depLibSet, &buildDir, &pcmDir, &libsString, &binDir, this, &buildResult, &resultsDep](){
for(Configuration& config2 : std::get<0>(config.dependencies[i])->configurations) { for(Configuration& config2 : std::get<0>(config.dependencies[i])->configurations) {
@ -366,6 +370,9 @@ namespace Crafter {
return buildResult; return buildResult;
} }
std::cout << "bruh 7" << std::endl;
for(const fs::path& cFile: config.c_files) { for(const fs::path& cFile: config.c_files) {
files+=std::format(" {}_source.o ",(buildDir/cFile.filename()).string()); files+=std::format(" {}_source.o ",(buildDir/cFile.filename()).string());
if(!fs::exists((buildDir/cFile.filename()).string()+"_source.o") || fs::last_write_time(cFile.string()+".c") > fs::last_write_time((buildDir/cFile.filename()).string()+"_source.o")) { if(!fs::exists((buildDir/cFile.filename()).string()+"_source.o") || fs::last_write_time(cFile.string()+".c") > fs::last_write_time((buildDir/cFile.filename()).string()+"_source.o")) {
@ -424,6 +431,9 @@ namespace Crafter {
return buildResult; return buildResult;
} }
std::cout << "bruh 8" << std::endl;
if(config.target != "wasm32-wasi") { if(config.target != "wasm32-wasi") {
command += " -L/usr/local/lib"; command += " -L/usr/local/lib";
} }

View file

@ -66,6 +66,9 @@ int main(int argc, char* argv[]) {
projectPath = filepath; projectPath = filepath;
} }
#if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32)
AutoDetect();
#endif
Project project(std::move(projectPath)); Project project(std::move(projectPath));
if(command == "build") { if(command == "build") {

View file

@ -63,7 +63,6 @@
"extends": ["base", "libs-windows-msvc-debug"], "extends": ["base", "libs-windows-msvc-debug"],
"type":"library", "type":"library",
"implementations": ["implementations/main"], "implementations": ["implementations/main"],
"lib_dirs": ["C:\\VulkanSDK\\1.4.341.1\\Lib"],
"debug": true "debug": true
} }
] ]