]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: do not compile crush twice 14725/head
authorKefu Chai <kchai@redhat.com>
Sat, 22 Apr 2017 12:35:15 +0000 (20:35 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 22 Apr 2017 16:05:19 +0000 (00:05 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/CMakeLists.txt
src/erasure-code/lrc/CMakeLists.txt
src/test/crush/CMakeLists.txt
src/test/erasure-code/CMakeLists.txt

index f5e90761586c2728e815e9b9a3b9562d6c43f08b..ea928d76f17a06a7d7440af05b233fef9b06e960 100644 (file)
@@ -326,7 +326,7 @@ set(crush_srcs
   crush/CrushTester.cc
   crush/CrushLocation.cc)
 
-add_library(crush STATIC ${crush_srcs})
+add_library(crush_objs OBJECT ${crush_srcs})
 
 add_subdirectory(json_spirit)
 
@@ -396,7 +396,6 @@ set(libcommon_files
   common/admin_socket_client.cc
   common/bloom_filter.cc
   common/Readahead.cc
-  ${crush_srcs}
   common/cmdparse.cc
   common/escape.c
   common/io_priority.cc
@@ -570,7 +569,8 @@ set(ceph_common_objs
   $<TARGET_OBJECTS:compressor_objs>
   $<TARGET_OBJECTS:common-objs>
   $<TARGET_OBJECTS:common_mountcephfs_objs>
-  $<TARGET_OBJECTS:global_common_objs>)
+  $<TARGET_OBJECTS:global_common_objs>
+  $<TARGET_OBJECTS:crush_objs>)
 set(ceph_common_deps
   json_spirit erasure_code rt ${LIB_RESOLV}
   ${Boost_THREAD_LIBRARY}
index f5b7980940221a13c5581ca054e7c54d83eee6ae..c25fc695f2fa273fcf82a18ef05199e04339206f 100644 (file)
@@ -4,6 +4,7 @@ set(lrc_srcs
   ErasureCodePluginLrc.cc
   ErasureCodeLrc.cc
   $<TARGET_OBJECTS:erasure_code_objs>
+  $<TARGET_OBJECTS:crush_objs>
   ${CMAKE_SOURCE_DIR}/src/common/str_map.cc
 )
 
@@ -11,7 +12,7 @@ add_library(ec_lrc SHARED ${lrc_srcs})
 add_dependencies(ec_lrc ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
 set_target_properties(ec_lrc PROPERTIES
   INSTALL_RPATH "")
-target_link_libraries(ec_lrc crush json_spirit)
+target_link_libraries(ec_lrc json_spirit)
 install(TARGETS ec_lrc DESTINATION ${erasure_plugin_dir})
 
 if(WITH_EMBEDDED)
index e6159c9ace825ee430f544a73f4a56b0d5e20bc6..0c7d7dca4d6b6c4e0935e3fea27835cfdd18a49b 100644 (file)
@@ -1,9 +1,8 @@
 # unittest_crush_wrapper
 add_executable(unittest_crush_wrapper
-  CrushWrapper.cc
-  )
+  CrushWrapper.cc)
 add_ceph_unittest(unittest_crush_wrapper ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_crush_wrapper)
-target_link_libraries(unittest_crush_wrapper global crush ${BLKID_LIBRARIES})
+target_link_libraries(unittest_crush_wrapper global ${BLKID_LIBRARIES})
 
 # unittest_crush
 add_executable(unittest_crush
index 5a5f2ab65c0db2132d6b46e84d958c1c09cc5ab8..1c4ca798433f3eb5206294631d74b3f2c6203266 100644 (file)
@@ -115,7 +115,6 @@ add_ceph_unittest(unittest_erasure_code_plugin_isa ${CMAKE_RUNTIME_OUTPUT_DIRECT
 target_link_libraries(unittest_erasure_code_plugin_isa
   global
   ceph-common
-  crush
   ${CMAKE_DL_LIBS}
   erasure_code
   )