Open thegoodtgg opened 2 days ago
After some digging, I found "vcpkg.exe" run "vcvarsall.bat" no "Windows SDK Version " specified.
Found a existed issue from vcpkg-tool: vcpkg-tool Window SDK Version Triplet Variable. I found it 0001-fix-repest-to-VCPKG_CMAKE_SYSTEM_VERSION.patch easy when using the value of VCPKG_CMAKE_SYSTEM_VERSION as the target passed to "vcvarsall.bat" instead of empty value.
From fe3de4081e046b70ee4e5ff6c5e99533bf7b99e6 Mon Sep 17 00:00:00 2001
From: tgg <thegoodtgg@outlook.com>
Date: Wed, 23 Oct 2024 15:28:43 +0800
Subject: [PATCH] fix: repest to VCPKG_CMAKE_SYSTEM_VERSION.
---
src/vcpkg/commands.build.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/vcpkg/commands.build.cpp b/src/vcpkg/commands.build.cpp
index d1a8a8d4..6c694782 100644
--- a/src/vcpkg/commands.build.cpp
+++ b/src/vcpkg/commands.build.cpp
@@ -311,10 +311,10 @@ namespace vcpkg
}
#if defined(_WIN32)
- static ZStringView to_vcvarsall_target(StringView cmake_system_name)
+ static ZStringView to_vcvarsall_target(StringView cmake_system_name, StringView cmake_system_version)
{
- if (cmake_system_name.empty()) return "";
- if (cmake_system_name == "Windows") return "";
+ if (cmake_system_name.empty()) return { cmake_system_version.data(), cmake_system_version.size() };
+ if (cmake_system_name == "Windows") return { cmake_system_version.data(), cmake_system_version.size()};
if (cmake_system_name == "WindowsStore") return "store";
Checks::msg_exit_with_error(VCPKG_LINE_INFO, msgUnsupportedSystemName, msg::system_name = cmake_system_name);
@@ -597,7 +597,7 @@ namespace vcpkg
}
const auto arch = to_vcvarsall_toolchain(pre_build_info.target_architecture, toolset, pre_build_info.triplet);
- const auto target = to_vcvarsall_target(pre_build_info.cmake_system_name);
+ const auto target = to_vcvarsall_target(pre_build_info.cmake_system_name, pre_build_info.cmake_system_version);
return vcpkg::Command{"cmd"}.string_arg("/d").string_arg("/c").raw_arg(
fmt::format(R"("{}" {} {} {} {} 2>&1 <NUL)",
--
2.41.0.windows.1
Describe the bug VCPKG_CMAKE_SYSTEM_VERSION not work.
Environment
To Reproduce Steps to reproduce the behavior: Use following triplet, install boost-headers 1.85.0
Expected behavior A clear and concise description of what you expected to happen.
Failure logs
Additional context I run into the problem recently. The problem is related to "WindowsSDKVersion". When using "Visual Studio 17 2022" with toolset "v142", "WindowsSDKVersion" must under "10.0.22xxx.0", or CMake would get a error while configure. Environment: Visual Studio 2022 17.11.5 and WindowSDKVersion "10.0.26100.0" Found a issue from poco repo: unresolved external symbol _guard_checkicall$fo$ And another related issue from STL: VCRuntime incompatibility with older version in mutex code, which cause me can't using v143 toolset and WindowSDKVersion "10.0.26100.0" config-x64-windows-static-su-out.log config-x64-windows-static-su-rel-CMakeCache.txt.log config-x64-windows-static-su-rel-CMakeConfigureLog.yaml.log
And when I run command "vcpkg env", I get following output:
I read the doc about vcpkg env. Is there any method to override WindowsSDKVersion. I try to use VCPKG_CHAINLOAD_TOOLCHAIN_FILE with a different toolchain file, however don't know how to make it work. @jimwang118