From: Viktor Szakats Date: Tue, 13 Aug 2024 11:44:27 +0000 (+0200) Subject: cmake: show warning if libpsl is not found X-Git-Tag: curl-8_10_0~250 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2401ee68a4ac4724aeab0f758aca04c00a8a27a1;p=thirdparty%2Fcurl.git cmake: show warning if libpsl is not found Also: - explicitly disable libpsl in CI to avoid configure warning, where necessary. - add TODO to make this warning an error (to match autotools.) Follow-up to 2998874bb61ac6ef3b72d6a61467cd2aaf6e53ea #12661 Closes #14533 --- diff --git a/.github/workflows/awslc.yml b/.github/workflows/awslc.yml index 5f0e319807..10b95dd997 100644 --- a/.github/workflows/awslc.yml +++ b/.github/workflows/awslc.yml @@ -114,7 +114,7 @@ jobs: - run: | sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list sudo apt-get update - sudo apt-get install cmake stunnel4 + sudo apt-get install cmake stunnel4 libpsl-dev # ensure we don't pick up openssl in this build sudo apt remove --yes libssl-dev sudo python3 -m pip install impacket diff --git a/.github/workflows/configure-vs-cmake.yml b/.github/workflows/configure-vs-cmake.yml index 44398e3554..299230e957 100644 --- a/.github/workflows/configure-vs-cmake.yml +++ b/.github/workflows/configure-vs-cmake.yml @@ -41,7 +41,7 @@ jobs: - name: run cmake run: | - cmake -B build + cmake -B build -DCURL_USE_LIBPSL=OFF - name: compare generated curl_config.h files run: ./.github/scripts/cmp-config.pl lib/curl_config.h build/lib/curl_config.h @@ -62,7 +62,7 @@ jobs: - name: run cmake run: | - cmake -B build \ + cmake -B build -DCURL_USE_LIBPSL=OFF \ "-DCMAKE_C_COMPILER_TARGET=$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \ -DCURL_USE_LIBSSH2=OFF diff --git a/.github/workflows/distcheck.yml b/.github/workflows/distcheck.yml index aee1b01ad0..d8ea8a80ef 100644 --- a/.github/workflows/distcheck.yml +++ b/.github/workflows/distcheck.yml @@ -118,7 +118,7 @@ jobs: echo "::stop-commands::$(uuidgen)" tar xvf curl-99.98.97.tar.gz pushd curl-99.98.97 - cmake -B build -DCURL_WERROR=ON + cmake -B build -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF make -C build -j5 name: 'verify out-of-tree cmake build' diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b432d4ee63..30f1144e40 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -598,7 +598,7 @@ jobs: "-DCMAKE_C_COMPILER_TARGET=$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \ -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF \ -DUSE_NGHTTP2=OFF -DUSE_LIBIDN2=OFF -DUSE_APPLE_IDN=OFF \ - -DCURL_USE_LIBSSH2=OFF \ + -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF \ ${options} fi diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 212b42f262..a2e5eb873e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -296,6 +296,7 @@ jobs: -DCURL_WERROR=ON \ -DBUILD_EXAMPLES=ON \ -DENABLE_WEBSOCKETS=ON \ + -DCURL_USE_LIBPSL=OFF \ ${{ matrix.config }} - name: 'cmake configure log' @@ -373,7 +374,7 @@ jobs: plat: 'uwp' type: 'Debug' tflags: 'skipall' - config: '-DENABLE_DEBUG=ON -DENABLE_UNICODE=OFF -DCURL_USE_SCHANNEL=OFF -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_LIBSSH2=ON -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON' + config: '-DENABLE_DEBUG=ON -DENABLE_UNICODE=OFF -DCURL_USE_SCHANNEL=OFF -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBPSL=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_USE_LIBSSH2=ON -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON' - name: 'libressl' install: 'brotli zlib zstd libpsl nghttp2 libressl libssh2[core,zlib]' arch: 'x64' diff --git a/CMakeLists.txt b/CMakeLists.txt index 20902aeb13..c5b465b06e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1047,13 +1047,15 @@ mark_as_advanced(CURL_USE_LIBPSL) set(USE_LIBPSL OFF) if(CURL_USE_LIBPSL) - find_package(LibPSL) + find_package(LibPSL) # TODO: add REQUIRED to match autotools if(LIBPSL_FOUND) list(APPEND CURL_LIBS ${LIBPSL_LIBRARIES}) list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libpsl") list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBPSL_INCLUDE_DIRS}") include_directories(${LIBPSL_INCLUDE_DIRS}) set(USE_LIBPSL ON) + else() + message(WARNING "libpsl is enabled, but not found.") endif() endif() diff --git a/appveyor.sh b/appveyor.sh index 5f39dddd27..692084b1d5 100644 --- a/appveyor.sh +++ b/appveyor.sh @@ -60,7 +60,8 @@ if [ "${BUILD_SYSTEM}" = 'CMake' ]; then "-DENABLE_DEBUG=${DEBUG}" \ "-DENABLE_UNICODE=${ENABLE_UNICODE}" \ '-DCMAKE_INSTALL_PREFIX=C:/curl' \ - "-DCMAKE_BUILD_TYPE=${PRJ_CFG}" + "-DCMAKE_BUILD_TYPE=${PRJ_CFG}" \ + '-DCURL_USE_LIBPSL=OFF' # shellcheck disable=SC2086 if ! cmake --build _bld --config "${PRJ_CFG}" --parallel 2 -- ${BUILD_OPT:-}; then if [ "${PRJ_GEN}" = 'Visual Studio 9 2008' ]; then