2020-12-02 05:49:39 +08:00
|
|
|
vcpkg_fail_port_install(ON_TARGET "uwp")
|
2018-03-08 04:06:30 +08:00
|
|
|
|
2017-05-11 06:08:52 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO c-ares/c-ares
|
2021-08-12 10:03:07 +08:00
|
|
|
REF cares-1_17_2
|
|
|
|
SHA512 1111f1e7eeb0e5d9e70d1a7c8566145d0a5e6e71b020f3fcaa02ecdf1931553ddeff83fdc152a1f9c5a780078e8afe3670164b631df56eecd2b638210cc59bb3
|
2017-05-11 06:08:52 +08:00
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
2021-04-13 01:24:05 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)
|
2017-05-11 06:08:52 +08:00
|
|
|
|
2021-08-27 01:09:08 +08:00
|
|
|
vcpkg_cmake_configure(
|
2017-05-11 06:08:52 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
OPTIONS
|
2021-04-13 01:24:05 +08:00
|
|
|
-DCARES_STATIC=${BUILD_STATIC}
|
|
|
|
-DCARES_SHARED=${BUILD_SHARED}
|
|
|
|
-DCARES_BUILD_TOOLS=OFF
|
|
|
|
-DCARES_BUILD_TESTS=OFF
|
|
|
|
-DCARES_BUILD_CONTAINER_TESTS=OFF
|
2017-05-11 06:08:52 +08:00
|
|
|
)
|
|
|
|
|
2021-08-27 01:09:08 +08:00
|
|
|
vcpkg_cmake_install()
|
2017-05-11 06:08:52 +08:00
|
|
|
|
2021-04-13 01:24:05 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2021-08-27 01:09:08 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/c-ares)
|
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2017-06-10 06:39:32 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
2021-08-27 01:09:08 +08:00
|
|
|
vcpkg_replace_string(
|
|
|
|
"${CURRENT_PACKAGES_DIR}/include/ares.h"
|
2021-04-13 01:24:05 +08:00
|
|
|
"#ifdef CARES_STATICLIB" "#if 1"
|
2017-06-10 06:39:32 +08:00
|
|
|
)
|
2021-08-03 07:55:47 +08:00
|
|
|
endif()
|
2017-05-11 06:08:52 +08:00
|
|
|
|
2021-08-03 07:55:47 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static OR NOT VCPKG_TARGET_IS_WINDOWS)
|
2021-04-13 01:24:05 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") # Empty folders
|
|
|
|
endif()
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
|
2017-05-11 06:08:52 +08:00
|
|
|
|
|
|
|
# Handle copyright
|
2021-04-13 01:24:05 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|