[PATCH] D121718: [Debuginfod] Check libcurl via CMake library.

Daniel Thornburgh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 15 10:27:59 PDT 2022


mysterymath created this revision.
mysterymath added reviewers: phosek, MaskRay.
Herald added a subscriber: mgorny.
Herald added a project: All.
mysterymath requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121718

Files:
  llvm/cmake/config-ix.cmake


Index: llvm/cmake/config-ix.cmake
===================================================================
--- llvm/cmake/config-ix.cmake
+++ llvm/cmake/config-ix.cmake
@@ -169,8 +169,7 @@
     # 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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121718.415493.patch
Type: text/x-patch
Size: 705 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220315/12bb3e6b/attachment.bin>


More information about the llvm-commits mailing list