Skip to content

Commit 1da2c5b

Browse files
committed
[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
1 parent 687d20d commit 1da2c5b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/cmake/config-ix.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ if(LLVM_ENABLE_CURL)
169169
# Check if curl we found is usable; for example, we may have found a 32-bit
170170
# library on a 64-bit system which would result in a link-time failure.
171171
cmake_push_check_state()
172-
list(APPEND CMAKE_REQUIRED_INCLUDES ${CURL_INCLUDE_DIRS})
173-
list(APPEND CMAKE_REQUIRED_LIBRARIES ${CURL_LIBRARY})
172+
list(APPEND CMAKE_REQUIRED_LIBRARIES CURL::libcurl)
174173
check_symbol_exists(curl_easy_init curl/curl.h HAVE_CURL)
175174
cmake_pop_check_state()
176175
if(LLVM_ENABLE_CURL STREQUAL FORCE_ON AND NOT HAVE_CURL)

0 commit comments

Comments
 (0)