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-02 23:14:40 +01:00
commit fe4e552e31

View file

@ -151,23 +151,13 @@ namespace Crafter {
void AddLibsRecursive(std::string& libsString, std::unordered_set<std::string> depLibSet, Configuration& depConfig) { void AddLibsRecursive(std::string& libsString, std::unordered_set<std::string> depLibSet, Configuration& depConfig) {
for(const std::string& lib2 : depConfig.libs) { for(const std::string& lib2 : depConfig.libs) {
if (depLibSet.insert(lib2).second) { if (depLibSet.insert(lib2).second) {
#ifdef CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_linux_gnu
libsString += std::format(" -l{}", lib2); libsString += std::format(" -l{}", lib2);
#endif
#if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32)
libsString+=std::format(" {}.lib", lib2);
#endif
} }
} }
for(const std::tuple<std::shared_ptr<Project>, Configuration&>& dep2 : depConfig.dependencies) { for(const std::tuple<std::shared_ptr<Project>, Configuration&>& dep2 : depConfig.dependencies) {
std::string outputLib = std::get<0>(dep2)->name+std::get<1>(dep2).name; std::string outputLib = std::get<0>(dep2)->name+std::get<1>(dep2).name;
if (depLibSet.insert(outputLib).second) { if (depLibSet.insert(outputLib).second) {
#ifdef CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_linux_gnu
libsString += std::format(" -l{}", outputLib); libsString += std::format(" -l{}", outputLib);
#endif
#if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32)
libsString+=std::format(" {}.lib", outputLib);
#endif
} }
AddLibsRecursive(libsString, depLibSet, std::get<1>(dep2)); AddLibsRecursive(libsString, depLibSet, std::get<1>(dep2));
} }
@ -484,7 +474,7 @@ namespace Crafter {
#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)
RunClang(std::format("clang-lib.exe {} /OUT:{}.lib", files, (binDir/fs::path(outputName)).string())); RunClang(std::format("llvm-lib.exe {} /OUT:{}.lib", files, (binDir/fs::path(outputName)).string()));
#endif #endif
} else { } else {
buildResult.errors = RunClang(std::format("{}{} -shared -o {}.so -Wl,-rpath,'$ORIGIN' -fuse-ld=lld", command, files, (binDir/(std::string("lib")+outputName)).string())); buildResult.errors = RunClang(std::format("{}{} -shared -o {}.so -Wl,-rpath,'$ORIGIN' -fuse-ld=lld", command, files, (binDir/(std::string("lib")+outputName)).string()));