aboutsummaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorJack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>2021-04-13 01:24:05 +0800
committerGitHub <noreply@github.com>2021-04-12 10:24:05 -0700
commitbc4cca67354ce62fdf97dd061043dad10274a15b (patch)
treec78b8195b845b5729edb345d05cfabe79dfe56b0 /ports
parentd01ed0ebd93b0b2036557c673c4fdeb35f98001c (diff)
downloadvcpkg-bc4cca67354ce62fdf97dd061043dad10274a15b.tar.gz
vcpkg-bc4cca67354ce62fdf97dd061043dad10274a15b.zip
[c-ares] Fix definition on static build, add options to disable tools and tests (#17230)
* [c-ares] Fix definition on static build, add options to disable tools and tests * update version record
Diffstat (limited to 'ports')
-rw-r--r--ports/c-ares/CONTROL5
-rw-r--r--ports/c-ares/portfile.cmake38
-rw-r--r--ports/c-ares/vcpkg.json8
3 files changed, 23 insertions, 28 deletions
diff --git a/ports/c-ares/CONTROL b/ports/c-ares/CONTROL
deleted file mode 100644
index c7243e1e8..000000000
--- a/ports/c-ares/CONTROL
+++ /dev/null
@@ -1,5 +0,0 @@
-Source: c-ares
-Version: 1.17.1
-Homepage: https://github.com/c-ares/c-ares
-Description: A C library for asynchronous DNS requests
-Supports: !uwp \ No newline at end of file
diff --git a/ports/c-ares/portfile.cmake b/ports/c-ares/portfile.cmake
index a42fc9fc3..0ec1740da 100644
--- a/ports/c-ares/portfile.cmake
+++ b/ports/c-ares/portfile.cmake
@@ -8,43 +8,35 @@ vcpkg_from_github(
HEAD_REF master
)
-if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
- set(CARES_STATIC 1)
- set(CARES_SHARED 0)
-else()
- set(CARES_STATIC 0)
- set(CARES_SHARED 1)
-endif()
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
- -DCARES_STATIC=${CARES_STATIC}
- -DCARES_SHARED=${CARES_SHARED}
+ -DCARES_STATIC=${BUILD_STATIC}
+ -DCARES_SHARED=${BUILD_SHARED}
+ -DCARES_BUILD_TOOLS=OFF
+ -DCARES_BUILD_TESTS=OFF
+ -DCARES_BUILD_CONTAINER_TESTS=OFF
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/c-ares)
+vcpkg_copy_pdbs()
+
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
- file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
- file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
-else()
- file(GLOB EXE_FILES
- "${CURRENT_PACKAGES_DIR}/bin/*.exe"
- "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe"
+ vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/ares.h
+ "#ifdef CARES_STATICLIB" "#if 1"
)
- if (EXE_FILES)
- file(REMOVE ${EXE_FILES})
- endif()
-endif()
-vcpkg_copy_pdbs()
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") # Empty folders
+endif()
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
# Handle copyright
-file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
+file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/ports/c-ares/vcpkg.json b/ports/c-ares/vcpkg.json
new file mode 100644
index 000000000..a8833ac42
--- /dev/null
+++ b/ports/c-ares/vcpkg.json
@@ -0,0 +1,8 @@
+{
+ "name": "c-ares",
+ "version": "1.17.1",
+ "port-version": 1,
+ "description": "A C library for asynchronous DNS requests",
+ "homepage": "https://github.com/c-ares/c-ares",
+ "supports": "!uwp"
+}