mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-24 00:08:12 +08:00
0fe909718c
* [cryptopp] update to 7.0 * [cryptopp] Fix Linux builds
53 lines
1.8 KiB
CMake
53 lines
1.8 KiB
CMake
include(vcpkg_common_functions)
|
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH CMAKE_SOURCE_PATH
|
|
REPO noloader/cryptopp-cmake
|
|
REF 2729870f277bd568a8e8183b5ba7799e0c2dbf96
|
|
SHA512 fff9468774f66a895ab44ce76d37b320aeaa9398514b66d5116ffe84705ef7a202586622d598ea03f7c1636587893d46c6eee5e0da965c58fb74131c4b76223c
|
|
HEAD_REF master
|
|
PATCHES
|
|
cmake.patch
|
|
simon-speck.patch
|
|
)
|
|
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO weidai11/cryptopp
|
|
REF CRYPTOPP_7_0_0
|
|
SHA512 bc83f6adf0ae627c57ff9172d8cee69e7000d9b414ec903a50f11f9a68da08d1dd4985ddaffada86bf58e8168a2df065185efd932201d2df9db3f73025825e54
|
|
HEAD_REF master
|
|
PATCHES patch.patch
|
|
)
|
|
|
|
file(COPY ${CMAKE_SOURCE_PATH}/cryptopp-config.cmake DESTINATION ${SOURCE_PATH})
|
|
file(COPY ${CMAKE_SOURCE_PATH}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
|
|
|
# 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:
|
|
# https://www.cryptopp.com/wiki/Visual_Studio#Dynamic_Runtime_Linking
|
|
# https://www.cryptopp.com/wiki/Visual_Studio#The_DLL
|
|
|
|
vcpkg_configure_cmake(
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
PREFER_NINJA
|
|
OPTIONS
|
|
-DBUILD_SHARED=OFF
|
|
-DBUILD_STATIC=ON
|
|
-DBUILD_TESTING=OFF
|
|
-DBUILD_DOCUMENTATION=OFF
|
|
)
|
|
|
|
vcpkg_install_cmake()
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/cryptopp)
|
|
|
|
# There is no way to suppress installation of the headers and resource files in debug build.
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
# Handle copyright
|
|
file(COPY ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/cryptopp)
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/cryptopp/License.txt ${CURRENT_PACKAGES_DIR}/share/cryptopp/copyright)
|