]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: allows undefined symbol in plugin on osx
authorKefu Chai <kchai@redhat.com>
Wed, 13 Sep 2017 03:40:21 +0000 (11:40 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 16 Sep 2017 02:43:32 +0000 (10:43 +0800)
clang on osx erros out when linking a dynamic library if any symbols is
missing by default. so disable this behavior.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/CMakeLists.txt

index 510bd173d23727dc6182437366a1bf8fe80c7307..1f5b8d8aac57c7ecd98fe039dd871fc70bfae2bc 100644 (file)
@@ -52,6 +52,9 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-varargs")
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-gnu-designator")
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-braces -Wno-parentheses -Wno-deprecated-register")
+  if(APPLE)
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup")
+  endif()
 endif(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
 set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}")