diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/scripts/test_ports/vcpkg-ci-curl | |
Diffstat (limited to 'vcpkg/scripts/test_ports/vcpkg-ci-curl')
4 files changed, 180 insertions, 0 deletions
diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-curl/portfile.cmake b/vcpkg/scripts/test_ports/vcpkg-ci-curl/portfile.cmake new file mode 100644 index 0000000..d66f1b3 --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-curl/portfile.cmake @@ -0,0 +1,14 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +vcpkg_find_acquire_program(PKGCONFIG) + +vcpkg_cmake_configure( + SOURCE_PATH "${CURRENT_PORT_DIR}/project" + OPTIONS + "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" + OPTIONS_RELEASE + "-DCURL_CONFIG=${CURRENT_INSTALLED_DIR}/tools/curl/bin/curl-config" + OPTIONS_DEBUG + "-DCURL_CONFIG=${CURRENT_INSTALLED_DIR}/tools/curl/debug/bin/curl-config" +) +vcpkg_cmake_build() diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-curl/project/CMakeLists.txt b/vcpkg/scripts/test_ports/vcpkg-ci-curl/project/CMakeLists.txt new file mode 100644 index 0000000..ae54cc3 --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-curl/project/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.30) +project(libcurl-test C) + +block(SCOPE_FOR VARIABLES) + # blocked by FindOpenSSL in CMake 3.30: set(CMAKE_DISABLE_FIND_PACKAGE_PkgConfig 1) + + find_package(CURL COMPONENTS libz REQUIRED) + + add_executable(main main.c) + target_link_libraries(main PRIVATE CURL::libcurl) +endblock() + +block(SCOPE_FOR VARIABLES) + find_package(PkgConfig REQUIRED) + pkg_check_modules(libcurl_pc libcurl REQUIRED IMPORTED_TARGET) + + add_executable(main-pkgconfig main.c) + target_link_libraries(main-pkgconfig PRIVATE PkgConfig::libcurl_pc) +endblock() + +block(SCOPE_FOR VARIABLES) +if(NOT CMAKE_HOST_WIN32) + find_program(CURL_CONFIG NAMES curl-config REQUIRED) + execute_process(COMMAND "${CURL_CONFIG}" --cflags OUTPUT_VARIABLE curl-config-cflags OUTPUT_STRIP_TRAILING_WHITESPACE) + separate_arguments(curl-config-cflags UNIX_COMMAND "${curl-config-cflags}") + execute_process(COMMAND "${CURL_CONFIG}" --libs OUTPUT_VARIABLE curl-config-libs OUTPUT_STRIP_TRAILING_WHITESPACE) + separate_arguments(curl-config-libs UNIX_COMMAND "${curl-config-libs}") + string(REGEX REPLACE "(^-|;-)framework;" "\\1framework " curl-config-libs "${curl-config-libs}") + + add_executable(main-curl-config main.c) + target_compile_options(main-curl-config PRIVATE ${curl-config-cflags}) + target_link_libraries(main-curl-config PRIVATE ${curl-config-libs}) +endif() +endblock() diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-curl/project/main.c b/vcpkg/scripts/test_ports/vcpkg-ci-curl/project/main.c new file mode 100644 index 0000000..7002d69 --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-curl/project/main.c @@ -0,0 +1,10 @@ +#include <curl/curl.h> + +int main() +{ + CURL *curl = curl_easy_init(); + if(curl) { + curl_easy_cleanup(curl); + } + return 0; +} diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-curl/vcpkg.json b/vcpkg/scripts/test_ports/vcpkg-ci-curl/vcpkg.json new file mode 100644 index 0000000..d778693 --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-curl/vcpkg.json @@ -0,0 +1,122 @@ +{ + "name": "vcpkg-ci-curl", + "version-string": "ci", + "description": "Port to force features of certain ports within CI", + "homepage": "https://github.com/microsoft/vcpkg", + "license": "MIT", + "dependencies": [ + { + "name": "curl", + "default-features": false + }, + { + "name": "vcpkg-cmake", + "host": true + } + ], + "default-features": [ + "compression", + "misc", + "security" + ], + "features": { + "compression": { + "description": "Compression features", + "dependencies": [ + { + "name": "curl", + "default-features": false, + "features": [ + "zstd" + ] + }, + { + "$comment": "Known to break aws-sdk-cpp.", + "name": "curl", + "default-features": false, + "features": [ + "brotli" + ], + "platform": "!osx" + } + ] + }, + "misc": { + "description": "Misc features", + "dependencies": [ + { + "name": "curl", + "default-features": false, + "features": [ + "c-ares", + "http2", + "httpsrr", + "idn", + "rtmp", + "ssh", + "ssls-export" + ] + }, + { + "name": "curl", + "default-features": false, + "features": [ + "psl" + ], + "platform": "!uwp" + }, + { + "name": "curl", + "default-features": false, + "features": [ + "ldap", + "tool" + ], + "platform": "!android & !uwp" + } + ] + }, + "security": { + "description": "Security features", + "dependencies": [ + { + "name": "curl", + "default-features": false, + "features": [ + "gsasl", + "mbedtls", + "openssl", + "ssl", + "wolfssl" + ], + "platform": "!uwp" + }, + { + "name": "curl", + "default-features": false, + "features": [ + "gssapi" + ], + "platform": "linux | osx" + }, + { + "name": "curl", + "default-features": false, + "features": [ + "sspi" + ], + "platform": "windows & !uwp" + }, + { + "$comment": "On arm, gnutls crypto symbols clash with openssl.", + "name": "curl", + "default-features": false, + "features": [ + "gnutls" + ], + "platform": "!android & !uwp & !xbox & !arm" + } + ] + } + } +} |