From 36c5c270990a2fe55f974e7d77bd7b24681629ba Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Mon, 21 Oct 2024 19:06:28 -0400 Subject: [PATCH] Disabling curl tests doesn't now disable kvikio cpp tests (#503) Works around https://github.com/curl/curl/issues/15351 . We cache the `BUILD_TESTING` cache variable when it exists so that our tests are enabled when building curl from source. Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: - Tianyu Liu (https://github.com/kingcrimsontianyu) - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/kvikio/pull/503 --- cpp/cmake/thirdparty/get_libcurl.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cpp/cmake/thirdparty/get_libcurl.cmake b/cpp/cmake/thirdparty/get_libcurl.cmake index 7695592737..5694494b9a 100644 --- a/cpp/cmake/thirdparty/get_libcurl.cmake +++ b/cpp/cmake/thirdparty/get_libcurl.cmake @@ -16,6 +16,11 @@ function(find_and_configure_libcurl) include(${rapids-cmake-dir}/cpm/find.cmake) + # Work around https://github.com/curl/curl/issues/15351 + if(DEFINED CACHE{BUILD_TESTING}) + set(CACHE_HAS_BUILD_TESTING $CACHE{BUILD_TESTING}) + endif() + rapids_cpm_find( CURL 7.87.0 GLOBAL_TARGETS libcurl @@ -27,6 +32,14 @@ function(find_and_configure_libcurl) OPTIONS "BUILD_CURL_EXE OFF" "BUILD_SHARED_LIBS OFF" "BUILD_TESTING OFF" "CURL_USE_LIBPSL OFF" "CURL_DISABLE_LDAP ON" "CMAKE_POSITION_INDEPENDENT_CODE ON" ) + if(DEFINED CACHE_HAS_BUILD_TESTING) + set(BUILD_TESTING + ${CACHE_HAS_BUILD_TESTING} + CACHE BOOL "" FORCE + ) + else() + unset(BUILD_TESTING CACHE) + endif() endfunction() find_and_configure_libcurl()