Skip to content

Commit

Permalink
Build Boost with _WIN32_WINNT=_WIN32_WINNT_WIN10.
Browse files Browse the repository at this point in the history
In addition to a new pair of triplets ({x86,x64}-windows-win10) this
requires patching Boost.Log to add an import library.

See boostorg/log#177 for details.
  • Loading branch information
chrullrich authored and tradlux-chul committed Oct 14, 2024
1 parent b02b5eb commit 8021063
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ports/boost-log/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ vcpkg_from_github(
REF boost-${VERSION}
SHA512 aaae39126ae047721f71b7a55dc7a325af78c9af0b4e2d6f6d0cd7a440a0dc839acfa683c6dcb736434819e205e9d95ead56364dec60d069367d9976a45c4d17
HEAD_REF master
PATCHES
"synchronization-lib.patch"
"synchronization-lib2.patch"
)

set(FEATURE_OPTIONS "")
Expand Down
12 changes: 12 additions & 0 deletions ports/boost-log/synchronization-lib.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1d7df88..a22d546 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -330,6 +330,7 @@ if (WIN32 OR CYGWIN)
ws2_32
mswsock
advapi32
+ synchronization
)
endif()

22 changes: 22 additions & 0 deletions ports/boost-log/synchronization-lib2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/build/Jamfile.v2 b/build/Jamfile.v2
index c1555a3..eaed8a6 100644
--- a/build/Jamfile.v2
+++ b/build/Jamfile.v2
@@ -32,7 +32,8 @@ lib advapi32 ;
lib secur32 ;
lib ws2_32 ;
lib mswsock ;
-explicit psapi advapi32 secur32 ws2_32 mswsock ;
+lib synchronization ;
+explicit psapi advapi32 secur32 ws2_32 mswsock synchronization ;

# UNIX libs
lib rt ;
@@ -212,6 +213,7 @@ project boost/log
<target-os>windows:<library>ws2_32
<target-os>windows:<library>mswsock
<target-os>windows:<library>advapi32
+ <target-os>windows:<library>synchronization

<target-os>cygwin:<define>BOOST_USE_WINDOWS_H
# Boost.Interprocess does not compile on Cygwin: https://github.com/boostorg/interprocess/issues/76
6 changes: 6 additions & 0 deletions triplets/x64-windows-win10.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)

set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} /DBOOST_USE_WINAPI_VERSION=0x0602 /D_WIN32_WINNT=0x0602 /DWINVER=0x0602")
set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} /DBOOST_USE_WINAPI_VERSION=0x0602 /D_WIN32_WINNT=0x0602 /DWINVER=0x0602")
6 changes: 6 additions & 0 deletions triplets/x86-windows-win10.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)

set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} /DBOOST_USE_WINAPI_VERSION=0x0602 /D_WIN32_WINNT=0x0602 /DWINVER=0x0602")
set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} /DBOOST_USE_WINAPI_VERSION=0x0602 /D_WIN32_WINNT=0x0602 /DWINVER=0x0602")

0 comments on commit 8021063

Please sign in to comment.