aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2018-03-29 18:34:38 -0700
committerRobert Schumacher <roschuma@microsoft.com>2018-03-29 18:34:38 -0700
commitca58367c9ae70739eb55fa46ed2b339e3aaf50df (patch)
tree86f18ab3325a3ac7766f2b63011bc44b4ab5560f
parentba7b8e6d7336fd4529cfe1de50b224a98d6ff496 (diff)
downloadvcpkg-ca58367c9ae70739eb55fa46ed2b339e3aaf50df.tar.gz
vcpkg-ca58367c9ae70739eb55fa46ed2b339e3aaf50df.zip
[cryptopp] Fix UWP builds
-rw-r--r--ports/cryptopp/CONTROL2
-rw-r--r--ports/cryptopp/cmake.patch15
-rw-r--r--ports/cryptopp/patch.patch12
-rw-r--r--ports/cryptopp/portfile.cmake7
4 files changed, 35 insertions, 1 deletions
diff --git a/ports/cryptopp/CONTROL b/ports/cryptopp/CONTROL
index ef8e6fd75..6fea020bd 100644
--- a/ports/cryptopp/CONTROL
+++ b/ports/cryptopp/CONTROL
@@ -1,3 +1,3 @@
Source: cryptopp
-Version: 6.1.0-1
+Version: 6.1.0-2
Description: Crypto++ is a free C++ class library of cryptographic schemes.
diff --git a/ports/cryptopp/cmake.patch b/ports/cryptopp/cmake.patch
new file mode 100644
index 000000000..fbe725eb9
--- /dev/null
+++ b/ports/cryptopp/cmake.patch
@@ -0,0 +1,15 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5b6e1e6..a0adcf6 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -329,6 +329,10 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FI\"winapifamily.h\"" )
+ endif ()
+
++if(WINDOWS_STORE)
++ add_definitions(-DCRYPTOPP_DISABLE_NACL=1)
++endif()
++
+ # Enable PIC for all target machines except 32-bit i386 due to register pressures.
+ if (NOT CRYPTOPP_I386)
+ SET(CMAKE_POSITION_INDEPENDENT_CODE 1)
diff --git a/ports/cryptopp/patch.patch b/ports/cryptopp/patch.patch
new file mode 100644
index 000000000..5c49d2757
--- /dev/null
+++ b/ports/cryptopp/patch.patch
@@ -0,0 +1,12 @@
+diff --git a/config.h b/config.h
+index b96b7aa..3f004ac 100644
+--- a/config.h
++++ b/config.h
+@@ -795,6 +795,7 @@ NAMESPACE_END
+ #endif
+
+ #ifdef CRYPTOPP_WIN32_AVAILABLE
++#include <winapifamily.h>
+ # if !defined(WINAPI_FAMILY)
+ # define THREAD_TIMER_AVAILABLE
+ # elif defined(WINAPI_FAMILY)
diff --git a/ports/cryptopp/portfile.cmake b/ports/cryptopp/portfile.cmake
index b0b59d29c..6b4b844c4 100644
--- a/ports/cryptopp/portfile.cmake
+++ b/ports/cryptopp/portfile.cmake
@@ -23,6 +23,13 @@ vcpkg_from_github(
file(COPY ${CMAKE_SOURCE_PATH}/cryptopp-config.cmake DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_SOURCE_PATH}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+vcpkg_apply_patches(
+ SOURCE_PATH "${SOURCE_PATH}"
+ PATCHES
+ "${CMAKE_CURRENT_LIST_DIR}/patch.patch"
+ "${CMAKE_CURRENT_LIST_DIR}/cmake.patch"
+)
+
# Dynamic linking should be avoided for Crypto++ to reduce the attack surface,
# so generate a static lib for both dynamic and static vcpkg targets.
# See also: