From 04533b57789ae5cb7f9f12b46bad5e1ae85a0da9 Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Mon, 2 Mar 2026 22:14:56 +0100 Subject: [PATCH] windows build fix --- implementations/Crafter.Build-Command.cpp | 10 +--------- implementations/Crafter.Build-Project.cpp | 2 +- implementations/main.cpp | 3 --- interfaces/Crafter.Build-Command.cppm | 4 ---- 4 files changed, 2 insertions(+), 17 deletions(-) diff --git a/implementations/Crafter.Build-Command.cpp b/implementations/Crafter.Build-Command.cpp index 92765bb..cf8217f 100644 --- a/implementations/Crafter.Build-Command.cpp +++ b/implementations/Crafter.Build-Command.cpp @@ -146,15 +146,7 @@ namespace Crafter { } } } - - void AutoDetect() { - std::string directoryPath = RunCommand("\"C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe\" -latest -property installationPath"); - - directoryPath.pop_back(); - - vsVars = std::format("\"{}\\VC\\Auxiliary\\Build\\vcvars64.bat\" > nul", directoryPath); - } - + #else std::string RunCommand(const std::string_view cmd) { diff --git a/implementations/Crafter.Build-Project.cpp b/implementations/Crafter.Build-Project.cpp index a597065..3e8c84c 100644 --- a/implementations/Crafter.Build-Project.cpp +++ b/implementations/Crafter.Build-Project.cpp @@ -458,7 +458,7 @@ namespace Crafter { #if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32) system("copy %LIBCXX_DIR%\\lib\\c++.dll \bin\executable-windows-msvc\\c++.dll"); - RunClang(std::format("{} && lib.exe {} /OUT:{}.lib", vsVars, files, (binDir/fs::path(outputName)).string())); + RunClang(std::format("clang-lib.exe {} /OUT:{}.lib", files, (binDir/fs::path(outputName)).string())); #endif } else { buildResult.errors = RunClang(std::format("{}{} -shared -o {}.so -Wl,-rpath,'$ORIGIN' -fuse-ld=lld", command, files, (binDir/(std::string("lib")+outputName)).string())); diff --git a/implementations/main.cpp b/implementations/main.cpp index 192587d..43c35ce 100644 --- a/implementations/main.cpp +++ b/implementations/main.cpp @@ -66,9 +66,6 @@ int main(int argc, char* argv[]) { 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)); if(command == "build") { diff --git a/interfaces/Crafter.Build-Command.cppm b/interfaces/Crafter.Build-Command.cppm index d13035e..bc127d0 100644 --- a/interfaces/Crafter.Build-Command.cppm +++ b/interfaces/Crafter.Build-Command.cppm @@ -38,10 +38,6 @@ namespace Crafter { export class Project; export class Configuration; - #if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32) - export std::string vsVars; - export void AutoDetect(); - #endif export std::string RunCommand(const std::string_view cmd); export void RunCommandIgnore(const std::string_view cmd); export std::string RunClang(const std::string_view cmd);