2021-09-15 10:06:34 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO aws/s2n-tls
|
2023-02-02 04:52:03 +08:00
|
|
|
REF "v${VERSION}"
|
2023-12-05 09:20:01 +08:00
|
|
|
SHA512 deead85f2ab22441e1110d442fc93273d96d8dd6a203940cca7ef166fc1c9e7ab75ffe2d550e013e1e1e3266b208904cff94cc2482d6fd00e0546293b0ba11d4
|
2021-12-15 02:49:00 +08:00
|
|
|
PATCHES
|
|
|
|
fix-cmake-target-path.patch
|
2021-09-15 10:06:34 +08:00
|
|
|
)
|
|
|
|
|
2021-12-15 02:49:00 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
tests BUILD_TESTING
|
|
|
|
)
|
2022-02-08 11:09:48 +08:00
|
|
|
|
|
|
|
set(EXTRA_ARGS)
|
|
|
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "wasm32")
|
|
|
|
set(EXTRA_ARGS "-DS2N_NO_PQ=TRUE")
|
|
|
|
endif()
|
|
|
|
|
2021-09-15 10:06:34 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2021-12-15 02:49:00 +08:00
|
|
|
OPTIONS
|
2022-02-08 11:09:48 +08:00
|
|
|
${EXTRA_ARGS}
|
2021-12-15 02:49:00 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2022-01-11 05:12:17 +08:00
|
|
|
-DUNSAFE_TREAT_WARNINGS_AS_ERRORS=OFF
|
2021-09-15 10:06:34 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_cmake_install()
|
2021-12-15 02:49:00 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2021-09-23 04:28:14 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/s2n/cmake)
|
2021-09-15 10:06:34 +08:00
|
|
|
|
2021-12-15 02:49:00 +08:00
|
|
|
if(BUILD_TESTING)
|
2023-02-02 04:52:03 +08:00
|
|
|
message(STATUS "Testing")
|
2021-12-15 02:49:00 +08:00
|
|
|
vcpkg_cmake_build(TARGET test LOGFILE_BASE test)
|
|
|
|
endif()
|
|
|
|
|
2021-09-15 10:06:34 +08:00
|
|
|
file(REMOVE_RECURSE
|
2021-09-23 04:28:14 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/include"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/lib/s2n"
|
2021-12-15 02:49:00 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/lib/s2n"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/share/s2n/modules"
|
|
|
|
)
|
2021-09-15 10:06:34 +08:00
|
|
|
|
|
|
|
# Handle copyright
|
2023-02-02 04:52:03 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|