[PATCH] D115189: [Support] [Debuginfod] Use libcurl imported library. (WIP)

Noah Shutty via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 6 18:07:50 PST 2021


noajshu updated this revision to Diff 392249.
noajshu marked an inline comment as done.
noajshu added a comment.

Rebase against main after landing D115131 <https://reviews.llvm.org/D115131>.
Now I am seeing this:

  CMake Warning (dev) in CMakeLists.txt:
    Policy CMP0111 is not set: An imported target missing its location property
    fails during generation.  Run "cmake --help-policy CMP0111" for policy
    details.  Use the cmake_policy command to set the policy and suppress this
    warning.
  
    IMPORTED_LOCATION not set for imported target "CURL::libcurl" configuration
    "Debug".
  This warning is for project developers.  Use -Wno-dev to suppress it.
  
  CMake Warning (dev) in CMakeLists.txt:
    Policy CMP0111 is not set: An imported target missing its location property
    fails during generation.  Run "cmake --help-policy CMP0111" for policy
    details.  Use the cmake_policy command to set the policy and suppress this
    warning.
  
    IMPORTED_LOCATION not set for imported target "CURL::libcurl" configuration
    "Debug".
  This warning is for project developers.  Use -Wno-dev to suppress it.
  
  CMake Warning (dev) in CMakeLists.txt:
    Policy CMP0111 is not set: An imported target missing its location property
    fails during generation.  Run "cmake --help-policy CMP0111" for policy
    details.  Use the cmake_policy command to set the policy and suppress this
    warning.
  
    IMPORTED_LOCATION not set for imported target "CURL::libcurl" configuration
    "Debug".
  This warning is for project developers.  Use -Wno-dev to suppress it.

  ninja: Entering directory `build'
  ninja: error: 'CURL::libcurl-NOTFOUND', needed by 'unittests/Debuginfod/DebuginfodTests', missing and no known rule to make it

And then when I try to build, I get


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115189/new/

https://reviews.llvm.org/D115189

Files:
  llvm/lib/Debuginfod/CMakeLists.txt


Index: llvm/lib/Debuginfod/CMakeLists.txt
===================================================================
--- llvm/lib/Debuginfod/CMakeLists.txt
+++ llvm/lib/Debuginfod/CMakeLists.txt
@@ -1,6 +1,6 @@
 # Link LibCURL if the user wants it
 if (LLVM_ENABLE_CURL)
-  set(imported_libs ${CURL_LIBRARIES})
+  set(imported_libs CURL::libcurl)
 endif()
 
 add_llvm_component_library(LLVMDebuginfod
@@ -17,4 +17,18 @@
   Support
   )
 
-set(llvm_system_libs ${system_libs})
+# This block is only needed for llvm-config. When we deprecate llvm-config and
+# move to using CMake export, this block can be removed.
+if(LLVM_ENABLE_CURL)
+  # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators.
+  if(CMAKE_BUILD_TYPE)
+    string(TOUPPER ${CMAKE_BUILD_TYPE} build_type)
+    get_property(curl_library TARGET CURL::libcurl PROPERTY LOCATION_${build_type})
+  endif()
+  if(NOT curl_library)
+    get_property(curl_library TARGET CURL::libcurl PROPERTY LOCATION)
+  endif()
+  get_library_name(${curl_library} curl_library)
+  set(llvm_system_libs ${llvm_system_libs} "${curl_library}")
+endif()
+


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115189.392249.patch
Type: text/x-patch
Size: 1108 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211207/b674d032/attachment.bin>


More information about the llvm-commits mailing list