Skip to content

Commit

Permalink
[Debuginfod] Check libcurl via CMake library.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mysterymath committed Mar 15, 2022
1 parent 687d20d commit 1da2c5b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions llvm/cmake/config-ix.cmake
Expand Up @@ -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)
Expand Down

0 comments on commit 1da2c5b

Please sign in to comment.