]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: show warning if libpsl is not found
authorViktor Szakats <commit@vsz.me>
Tue, 13 Aug 2024 11:44:27 +0000 (13:44 +0200)
committerViktor Szakats <commit@vsz.me>
Thu, 15 Aug 2024 08:38:46 +0000 (10:38 +0200)
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

.github/workflows/awslc.yml
.github/workflows/configure-vs-cmake.yml
.github/workflows/distcheck.yml
.github/workflows/macos.yml
.github/workflows/windows.yml
CMakeLists.txt
appveyor.sh

index 5f0e319807784acc47f8ba2537ece7ad1c507eca..10b95dd9978d3d732b9eebf081da9a842c612d58 100644 (file)
@@ -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
index 44398e3554a7dccff641e4bc25ff9312ab5c7391..299230e957f67d0b9afb7a80f8f81b4d0f4ec3c2 100644 (file)
@@ -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
 
index aee1b01ad06d10c44cd1fb6c2d39af4ec2c0dcb4..d8ea8a80efd02979d23fd727e5ba3505ef0eba17 100644 (file)
@@ -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'
 
index b432d4ee639d3e76a78cfe20c52cfade9bf647c9..30f1144e406c29131f3334f9b04c2aefc583f7be 100644 (file)
@@ -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
 
index 212b42f2621f635f282ce97d5c83ce0ec0197d4d..a2e5eb873ed5bb74a7d358c70fa16b0e7211ab8e 100644 (file)
@@ -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'
index 20902aeb13b3e35966a762602ab9c4b07fba641a..c5b465b06e43dc0a98ba0b28332060bd6f9dda0e 100644 (file)
@@ -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()
 
index 5f39dddd27f0f8f21a69c78e2bdf1151a685a777..692084b1d5fd8fa0b0ffb2f268fa6058355cc454 100644 (file)
@@ -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