diff options
| author | Daniel Strommen <nerdile@outlook.com> | 2018-03-18 04:31:30 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-03-18 04:31:30 -0700 |
| commit | 56560864e9cca01645fa19c65db9742d85a3e381 (patch) | |
| tree | ba7537d565482c7fe8868d5a1620df5cc8f0cc79 /ports/python3 | |
| parent | d9abd619fabb6aa6faab08d53ef08bf7f706390e (diff) | |
| download | vcpkg-56560864e9cca01645fa19c65db9742d85a3e381.tar.gz vcpkg-56560864e9cca01645fa19c65db9742d85a3e381.zip | |
Include windows.h before including consoleapi.h (#3050)
* Include windows.h before including consoleapi.h
Issue: cpython fails to build against Windows Insider Preview SDK 17115
Root Cause: Failure to include windows.h before other Windows headers (consoleapi.h)
Solution: Include windows.h before consoleapi.h
If you don't include Windows.h before other Windows headers, then your code
is likely to break with new versions of the Windows Platform SDK, as headers
move around or new intraheader dependencies are added. That is what happened
here.
* Remove redundant consoleapi.h
The documented header for all the console API's is windows.h,
which includes wincon.h which includes consoleapi.h. Consoleapi.h
used to also include windows.h, but this caused a circular dependency.
So, adjusting this to only include windows.h and omit the consoleapi.h
which is redundant.
* [python3] formatting
Diffstat (limited to 'ports/python3')
| -rw-r--r-- | ports/python3/0004-Fix-iomodule-for-RS4-SDK.patch | 12 | ||||
| -rw-r--r-- | ports/python3/portfile.cmake | 25 |
2 files changed, 22 insertions, 15 deletions
diff --git a/ports/python3/0004-Fix-iomodule-for-RS4-SDK.patch b/ports/python3/0004-Fix-iomodule-for-RS4-SDK.patch new file mode 100644 index 000000000..a0efc8d1c --- /dev/null +++ b/ports/python3/0004-Fix-iomodule-for-RS4-SDK.patch @@ -0,0 +1,12 @@ +diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c
+--- a/Modules/_io/_iomodule.c
++++ b/Modules/_io/_iomodule.c
+@@ -21,7 +21,7 @@
+ #endif /* HAVE_SYS_STAT_H */
+
+ #ifdef MS_WINDOWS
+-#include <consoleapi.h>
++#include <windows.h>
+ #endif
+
+ /* Various interned strings */
diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index 9bb50b70c..6285f9a9b 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -1,17 +1,4 @@ -# Common Ambient Variables: -# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} -# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} -# CURRENT_PORT DIR = ${VCPKG_ROOT_DIR}\ports\${PORT} -# PORT = current port name (zlib, etc) -# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc) -# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic) -# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic) -# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg> -# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm) -# if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic AND VCPKG_CRT_LINKAGE STREQUAL static) - # Because the patches patch the same file, they have to be applied in the correct order - # In this scenario, only the second patch needs to be applied, which doesn't work message(STATUS "Warning: Dynamic library with static CRT is not supported. Building static library.") set(VCPKG_LIBRARY_LINKAGE static) endif() @@ -29,8 +16,16 @@ vcpkg_from_github( REF v${PYTHON_VERSION} SHA512 32cca5e344ee66f08712ab5533e5518f724f978ec98d985f7612d0bd8d7f5cac25625363c9eead192faf1806d4ea3393515f72ba962a2a0bed26261e56d8c637 HEAD_REF master - ) +) + +vcpkg_apply_patches( + SOURCE_PATH ${TEMP_SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0004-Fix-iomodule-for-RS4-SDK.patch +) + # We need per-triplet directories because we need to patch the project files differently based on the linkage +# Because the patches patch the same file, they have to be applied in the correct order file(COPY ${TEMP_SOURCE_PATH} DESTINATION ${SOURCE_PATH}) set(SOURCE_PATH ${SOURCE_PATH}/cpython-${PYTHON_VERSION}) @@ -87,4 +82,4 @@ endif() file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/python${PYTHON_VERSION_MAJOR}) file(RENAME ${CURRENT_PACKAGES_DIR}/share/python${PYTHON_VERSION_MAJOR}/LICENSE ${CURRENT_PACKAGES_DIR}/share/python${PYTHON_VERSION_MAJOR}/copyright) -vcpkg_copy_pdbs()
\ No newline at end of file +vcpkg_copy_pdbs() |
