Skip to content
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

[vcpkg_cmake_configure/vcpkg_configure_cmake] Support VS2022 17.0 #19088

Merged
merged 12 commits into from
Sep 14, 2021
2 changes: 1 addition & 1 deletion ports/vcpkg-cmake/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "vcpkg-cmake",
"version-date": "2021-06-25",
"port-version": 5
"port-version": 6
}
47 changes: 30 additions & 17 deletions ports/vcpkg-cmake/vcpkg_cmake_configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,31 @@ function(vcpkg_cmake_configure)
if(DEFINED arg_GENERATOR)
set(generator "${arg_GENERATOR}")
elseif(arg_WINDOWS_USE_MSBUILD OR NOT ninja_can_be_used)
if(VCPKG_PLATFORM_TOOLSET STREQUAL "v120")
if(VCPKG_PLATFORM_TOOLSET STREQUAL "v143")
PhoebeHui marked this conversation as resolved.
Show resolved Hide resolved
set(generator "Visual Studio 17 2022")
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(generator "Visual Studio 12 2013")
set(arch "Win32")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(generator "Visual Studio 12 2013 Win64")
set(arch "x64")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(generator "Visual Studio 12 2013 ARM")
set(arch "ARM")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(arch "ARM64")
else()
set(generator)
endif()
elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v140")
elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v142")
set(generator "Visual Studio 16 2019")
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(generator "Visual Studio 14 2015")
set(arch "Win32")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(generator "Visual Studio 14 2015 Win64")
set(arch "x64")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(generator "Visual Studio 14 2015 ARM")
set(arch "ARM")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(arch "ARM64")
else()
set(generator)
endif()
elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v141")
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
Expand All @@ -177,18 +187,21 @@ function(vcpkg_cmake_configure)
set(generator "Visual Studio 15 2017")
set(arch "ARM64")
endif()
elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v142")
set(generator "Visual Studio 16 2019")
elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v140")
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(arch "Win32")
set(generator "Visual Studio 14 2015")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(arch "x64")
set(generator "Visual Studio 14 2015 Win64")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(arch "ARM")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(arch "ARM64")
else()
set(generator)
set(generator "Visual Studio 14 2015 ARM")
endif()
elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v120")
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(generator "Visual Studio 12 2013")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(generator "Visual Studio 12 2013 Win64")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(generator "Visual Studio 12 2013 ARM")
endif()
endif()
else()
Expand Down
2 changes: 2 additions & 0 deletions scripts/buildsystems/vcpkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ else()
set(Z_VCPKG_TARGET_TRIPLET_ARCH x86)
elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 16 2019$")
set(Z_VCPKG_TARGET_TRIPLET_ARCH x64)
elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 17 2022$")
set(Z_VCPKG_TARGET_TRIPLET_ARCH x64)
else()
find_program(Z_VCPKG_CL cl)
if(Z_VCPKG_CL MATCHES "amd64/cl.exe$" OR Z_VCPKG_CL MATCHES "x64/cl.exe$")
Expand Down
12 changes: 12 additions & 0 deletions scripts/cmake/vcpkg_configure_cmake.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,18 @@ function(vcpkg_configure_cmake)
set(GENERATOR "Visual Studio 16 2019")
set(ARCH "ARM64")

elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v143")
set(GENERATOR "Visual Studio 17 2022")
set(ARCH "Win32")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v143")
set(GENERATOR "Visual Studio 17 2022")
set(ARCH "x64")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v143")
set(GENERATOR "Visual Studio 17 2022")
set(ARCH "ARM")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v143")
set(GENERATOR "Visual Studio 17 2022")
set(ARCH "ARM64")
else()
if(NOT VCPKG_CMAKE_SYSTEM_NAME)
set(VCPKG_CMAKE_SYSTEM_NAME Windows)
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6562,7 +6562,7 @@
},
"vcpkg-cmake": {
"baseline": "2021-06-25",
"port-version": 5
"port-version": 6
},
"vcpkg-cmake-config": {
"baseline": "2021-05-22",
Expand Down
5 changes: 5 additions & 0 deletions versions/v-/vcpkg-cmake.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f942aa00e736764c72a2daa833a8c9f57ad49554",
"version-date": "2021-06-25",
"port-version": 6
},
{
"git-tree": "07c3e68ce9ae8f30bcc0b21def7a528dbb8ecb07",
"version-date": "2021-06-25",
Expand Down