From e61a9d8363786f65943e249f9b35d007dbe6b001 Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Sun, 1 Mar 2026 15:00:13 +0100 Subject: [PATCH] windows build fixes --- implementations/Crafter.Build-Project.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/implementations/Crafter.Build-Project.cpp b/implementations/Crafter.Build-Project.cpp index 4070f09..529291f 100644 --- a/implementations/Crafter.Build-Project.cpp +++ b/implementations/Crafter.Build-Project.cpp @@ -251,26 +251,22 @@ namespace Crafter { command += std::format(" --sysroot={} -fno-exceptions -fno-c++-static-destructors", (exeDir/"wasi-sysroot-28.0").string()); } - #ifdef CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_linux_gnu - if(define.value.empty()) { + for(const Define& define : config.defines) { + #ifdef CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_linux_gnu + if(define.value.empty()) { command += std::format(" -D {}", define.name); } else { command += std::format(" -D {}={}", define.name, define.value); } - } - #endif - #if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32) - if(define.value.empty()) { + #endif + #if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32) + if(define.value.empty()) { command += std::format(" /D {}", define.name); } else { command += std::format(" /D {}={}", define.name, define.value); } + #endif } - #endif - - - for(const Define& define : config.defines) { - fs::path pcmDir;