[llvm] 1da2c5b - [Debuginfod] Check libcurl via CMake library.

Daniel Thornburgh via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 15 11:26:32 PDT 2022


Author: Daniel Thornburgh
Date: 2022-03-15T18:26:25Z
New Revision: 1da2c5ba09aba541cc5dc44bb087999be57bacbe

URL: https://github.com/llvm/llvm-project/commit/1da2c5ba09aba541cc5dc44bb087999be57bacbe
DIFF: https://github.com/llvm/llvm-project/commit/1da2c5ba09aba541cc5dc44bb087999be57bacbe.diff

LOG: [Debuginfod] Check libcurl via CMake library.

If libcurl was built with CMake, CMake's FindCURL module defers
completely to the included config file. This config file doesn't set any
of the variables that the current check script depends on; it just sets
up an imported CMake target. Accordingly, the smoke test fails, since it
can't find the libcurl (or its static dependencies).

This changes the compile smoke test to refer to the imported library
instead; this should in turn bring in the necessary include and library
directories via the interface properties set up by CMake. This better
mirrors the way libcurl is referred to elsewhere in the CMakeLists.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D121718

Added: 
    

Modified: 
    llvm/cmake/config-ix.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index 18d78879c968f..bfe1fb6da4194 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -169,8 +169,7 @@ if(LLVM_ENABLE_CURL)
     # Check if curl we found is usable; for example, we may have found a 32-bit
     # library on a 64-bit system which would result in a link-time failure.
     cmake_push_check_state()
-    list(APPEND CMAKE_REQUIRED_INCLUDES ${CURL_INCLUDE_DIRS})
-    list(APPEND CMAKE_REQUIRED_LIBRARIES ${CURL_LIBRARY})
+    list(APPEND CMAKE_REQUIRED_LIBRARIES CURL::libcurl)
     check_symbol_exists(curl_easy_init curl/curl.h HAVE_CURL)
     cmake_pop_check_state()
     if(LLVM_ENABLE_CURL STREQUAL FORCE_ON AND NOT HAVE_CURL)


        


More information about the llvm-commits mailing list