From 223d1fd5500622ef5d021897f2cff325afc7aea2 Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Sun, 1 Mar 2026 15:06:36 +0100 Subject: [PATCH] windows build fixes --- implementations/Crafter.Build-Project.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/implementations/Crafter.Build-Project.cpp b/implementations/Crafter.Build-Project.cpp index 529291f..6fd996b 100644 --- a/implementations/Crafter.Build-Project.cpp +++ b/implementations/Crafter.Build-Project.cpp @@ -322,10 +322,7 @@ namespace Crafter { std::vector depThreads = std::vector(config.dependencies.size()); std::mutex libMutex; std::string files; - - #if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_linux_gnu) std::string libsString; - #endif std::vector resultsDep(config.dependencies.size()); @@ -434,7 +431,14 @@ namespace Crafter { command += " -L/usr/local/lib"; } - command += libsString; + if(config.type != CRAFTER_CONFIGURATION_TYPE_LIBRARY) { + #ifdef CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_linux_gnu + command += libsString; + #endif + #if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32) + files += libsString; + #endif + } #ifdef CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_linux_gnu for(const std::string& lib : config.libs) { @@ -468,7 +472,7 @@ namespace Crafter { libPath += std::format(" /LIBPATH:{}", lib); } - buildResult.errors = RunCommand(std::format("link {} {} .\\build\\std.o msvcrt.lib kernel32.lib user32.lib /OUT:{}.exe", lib, files, (binDir/outputName).string())); + buildResult.errors = RunCommand(std::format("link {} {} .\\build\\std.o msvcrt.lib kernel32.lib user32.lib /OUT:{}.exe", libPath, files, (binDir/outputName).string())); #endif } else if(config.type == CRAFTER_CONFIGURATION_TYPE_LIBRARY) { #ifdef CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_linux_gnu