From fe3de4081e046b70ee4e5ff6c5e99533bf7b99e6 Mon Sep 17 00:00:00 2001 From: tgg Date: Wed, 23 Oct 2024 15:28:43 +0800 Subject: [PATCH 1/2] 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 d1a8a8d494..6c694782d5 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 Date: Fri, 25 Oct 2024 15:14:16 +0800 Subject: [PATCH 2/2] chore: format. --- src/vcpkg/commands.build.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vcpkg/commands.build.cpp b/src/vcpkg/commands.build.cpp index 6c694782d5..08b87f8025 100644 --- a/src/vcpkg/commands.build.cpp +++ b/src/vcpkg/commands.build.cpp @@ -313,8 +313,8 @@ namespace vcpkg #if defined(_WIN32) static ZStringView to_vcvarsall_target(StringView cmake_system_name, StringView cmake_system_version) { - 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.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);