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}"
|
2024-03-28 06:22:32 +08:00
|
|
|
SHA512 86f0ccdc6aad63543786db7f0a8629c25008651259f4d3fd791c2bbd52cafe49ecd4824e42c55f85b03964ba2c349773fe47cacaad6794c4da349e28cc6d59d9
|
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")
|