[cryptopp] Fix UWP builds

This commit is contained in:
Robert Schumacher 2018-03-29 18:34:38 -07:00
parent ba7b8e6d73
commit ca58367c9a
4 changed files with 35 additions and 1 deletions

View File

@ -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.

View File

@ -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)

View File

@ -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)

View File

@ -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: