]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: add c-ares::cares as a global visible library 49121/head
authorKefu Chai <tchaikov@gmail.com>
Tue, 29 Nov 2022 13:40:19 +0000 (21:40 +0800)
committerKefu Chai <tchaikov@gmail.com>
Tue, 29 Nov 2022 13:42:26 +0000 (21:42 +0800)
to address the build failure like:

-- Checking for one of the modules 'libcares'
CMake Error at cmake/modules/BuildBoost.cmake:287 (_add_library):
  _add_library cannot create ALIAS target "c-ares::c-ares" because target
  "c-ares::cares" is imported but not globally visible.
Call Stack (most recent call first):
  cmake/modules/Findc-ares.cmake:31 (add_library)
  src/CMakeLists.txt:344 (find_package)

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
cmake/modules/Findc-ares.cmake

index 1e26c5c1c0fcadc9e746af7fda1d3c419e321835..56311c7c3eb2817cad6cae7a72805242e15acee2 100644 (file)
@@ -22,7 +22,7 @@ find_package_handle_standard_args(c-ares
   VERSION_VAR c-ares_VERSION)
 
 if(c-ares_FOUND AND NOT (TARGET c-ares::cares))
-  add_library(c-ares::cares UNKNOWN IMPORTED)
+  add_library(c-ares::cares UNKNOWN IMPORTED GLOBAL)
   set_target_properties(c-ares::cares PROPERTIES
     INTERFACE_INCLUDE_DIRECTORIES "${c-ares_INCLUDE_DIR}"
     IMPORTED_LINK_INTERFACE_LANGUAGES "C"