aboutsummaryrefslogtreecommitdiff
path: root/ports/python3/portfile.cmake
diff options
context:
space:
mode:
authorAdam Johnson <AdamJohnso@gmail.com>2021-09-29 12:00:21 -0400
committerGitHub <noreply@github.com>2021-09-29 09:00:21 -0700
commitf819f66b4c2a639e18233bc30deb98531a386f78 (patch)
tree9ddc0edc67de15f109bd17bea2de9c68ea43d706 /ports/python3/portfile.cmake
parent6d4792b777078a8206f291075964c5870ae46c6c (diff)
downloadvcpkg-f819f66b4c2a639e18233bc30deb98531a386f78.tar.gz
vcpkg-f819f66b4c2a639e18233bc30deb98531a386f78.zip
[python3] Add patch to fix Windows 11 SDK build failure. (#20292)
* [python3] Remove spurious dependencies. * [python3] Add workaround for SDK 10.0.22000.0 * x-add-version
Diffstat (limited to 'ports/python3/portfile.cmake')
-rw-r--r--ports/python3/portfile.cmake14
1 files changed, 9 insertions, 5 deletions
diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake
index 069008408..2ea878377 100644
--- a/ports/python3/portfile.cmake
+++ b/ports/python3/portfile.cmake
@@ -28,6 +28,14 @@ elseif(VCPKG_TARGET_IS_WINDOWS AND CMAKE_SYSTEM_VERSION EQUAL 6.1)
message(FATAL_ERROR "python3 requires the feature deprecated-win7-support when building on Windows 7.")
endif()
+# The Windows 11 SDK has a problem that causes it to error on the resource files, so we patch that.
+if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
+ vcpkg_get_windows_sdk(WINSDK_VERSION)
+ if("${WINSDK_VERSION}" VERSION_GREATER_EQUAL "10.0.22000")
+ list(APPEND PATCHES "0008-workaround-windows-11-sdk-rc-compiler-error.patch")
+ endif()
+endif()
+
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO python/cpython
@@ -88,11 +96,6 @@ if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
"/p:ForceImportBeforeCppTargets=${SOURCE_PATH}/PCbuild/python_vcpkg.props"
)
endif()
- string(REPLACE "\\" "" WindowsSDKVersion "$ENV{WindowsSDKVersion}")
- list(APPEND OPTIONS
- "/p:WindowsTargetPlatformVersion=${WindowsSDKVersion}"
- "/p:DefaultWindowsSDKVersion=${WindowsSDKVersion}"
- )
if(VCPKG_TARGET_IS_UWP)
list(APPEND OPTIONS "/p:IncludeUwp=true")
else()
@@ -117,6 +120,7 @@ if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
PROJECT_SUBPATH "PCbuild/pcbuild.proj"
OPTIONS ${OPTIONS}
LICENSE_SUBPATH "LICENSE"
+ TARGET_PLATFORM_VERSION "${WINSDK_VERSION}"
SKIP_CLEAN
)