2024-09-09 03:04:08 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY) # https://github.com/Mbed-TLS/mbedtls/issues/470
|
|
|
|
endif()
|
2017-12-09 16:00:06 +08:00
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2024-09-09 03:04:08 +08:00
|
|
|
REPO Mbed-TLS/mbedtls
|
2023-10-28 07:54:05 +08:00
|
|
|
REF "v${VERSION}"
|
2024-09-09 03:04:08 +08:00
|
|
|
SHA512 e7985a4e7e07328ae55fdad5212f71ac6af903f2b670c6d4bc2a8d6a4b9b7343697a2fd350a836b9425590c838615cd5b2fa851940bd137bb759fa35cd9f0ee8
|
|
|
|
HEAD_REF development
|
2020-03-12 00:15:12 +08:00
|
|
|
PATCHES
|
|
|
|
enable-pthread.patch
|
|
|
|
)
|
2024-09-09 03:04:08 +08:00
|
|
|
file(WRITE "${SOURCE_PATH}/framework/CMakeLists.txt" "# empty placeholder")
|
2020-03-12 00:15:12 +08:00
|
|
|
|
|
|
|
vcpkg_check_features(
|
|
|
|
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
2024-09-09 03:04:08 +08:00
|
|
|
pthreads LINK_WITH_PTHREAD
|
2017-12-09 16:00:06 +08:00
|
|
|
)
|
|
|
|
|
2024-09-09 03:04:08 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" USE_SHARED_MBEDTLS_LIBRARY)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" USE_STATIC_MBEDTLS_LIBRARY)
|
|
|
|
|
2022-03-29 04:36:33 +08:00
|
|
|
vcpkg_cmake_configure(
|
2024-09-09 03:04:08 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2017-12-09 16:00:06 +08:00
|
|
|
OPTIONS
|
2020-03-12 00:15:12 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2017-12-09 16:00:06 +08:00
|
|
|
-DENABLE_TESTING=OFF
|
|
|
|
-DENABLE_PROGRAMS=OFF
|
2021-01-25 15:37:22 +08:00
|
|
|
-DMBEDTLS_FATAL_WARNINGS=FALSE
|
2024-09-09 03:04:08 +08:00
|
|
|
-DUSE_SHARED_MBEDTLS_LIBRARY=${USE_SHARED_MBEDTLS_LIBRARY}
|
|
|
|
-DUSE_STATIC_MBEDTLS_LIBRARY=${USE_STATIC_MBEDTLS_LIBRARY}
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DINSTALL_MBEDTLS_HEADERS=OFF
|
2017-12-09 16:00:06 +08:00
|
|
|
)
|
|
|
|
|
2022-03-29 04:36:33 +08:00
|
|
|
vcpkg_cmake_install()
|
2022-01-26 02:31:15 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2024-07-21 02:32:00 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2024-09-09 03:04:08 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/MbedTLS")
|
|
|
|
|
|
|
|
if(LINK_WITH_PTHREAD)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/mbedtls/mbedtls_config.h" "#ifdef LINK_WITH_PTHREAD" "#if 1")
|
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|