-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set the Windows SDK version selected by vcvarsall.bat to VCPKG_CMAKE_SYSTEM_VERSION. #1532
base: main
Are you sure you want to change the base?
Conversation
The documentation for Thanks for your contribution! |
Yes. I see the desc about |
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"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not analyzed everything this code is doing, but returning "store" in one path and returning a version number in another path is almost certainly wrong.
Moreover, this does not meet the ZStringView requirements because it's returning a pointer that it claims is null terminated with inputs that are not null terminated.
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This 'request changes' is for the ZStringView out of contract use. I'm going to confirm with other maintainers if the overall change seems correct but it seems reasonable to me given the documentation page you mentioned.
Windows SDK Version doesn't belong to msvc toolset. And as positional arguments, "winsdk_version" should be placed after "platform_type". So using ”vcvarsall_options“ maybe not be a good choice. 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);
// New function
const auto winsdk = to_vcvarsall_winsdk(pre_build_info.cmake_system_version);
return vcpkg::Command{"cmd"}.string_arg("/d").string_arg("/c").raw_arg(
fmt::format(R"("{}" {} {} {} {} {} 2>&1 <NUL)",
toolset.vcvarsall,
Strings::join(" ", toolset.vcvarsall_options),
arch,
target,
winsdk,
tonull)); |
Getting it into the environment does belong to
Sure, I apologize for being unclear. I was posting that as a 'for example', the main point being that this needs to go into a There does not appear to be a positional parameter that sets the Windows SDK version.
Sure, separating into a separate function could be fine. I don't think it's required though. |
If we don't check the specified version of windows sdk installed, we could use
|
According to VCPKG_CMAKE_SYSTEM_VERSION not work. #41723, pass value of VCPKG_CMAKE_SYSTEM_VERSION as target to "vcvarsall.bat"