diff options
author | Kefu Chai <kchai@redhat.com> | 2017-04-22 14:35:15 +0200 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2017-04-22 18:05:19 +0200 |
commit | 0f5947d31e41e0c08a00d4d4339fc525ed6a28bd (patch) | |
tree | cef44058ec7ddf8384567b318f7338d59430f284 | |
parent | Merge pull request #14707 from wjwithagen/wip-wjw-freebsd-kqueue-logging (diff) | |
download | ceph-0f5947d31e41e0c08a00d4d4339fc525ed6a28bd.tar.xz ceph-0f5947d31e41e0c08a00d4d4339fc525ed6a28bd.zip |
cmake: do not compile crush twice
Signed-off-by: Kefu Chai <kchai@redhat.com>
-rw-r--r-- | src/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/erasure-code/lrc/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/test/crush/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/test/erasure-code/CMakeLists.txt | 1 |
4 files changed, 7 insertions, 8 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f5e90761586..ea928d76f17 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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} diff --git a/src/erasure-code/lrc/CMakeLists.txt b/src/erasure-code/lrc/CMakeLists.txt index f5b79809402..c25fc695f2f 100644 --- a/src/erasure-code/lrc/CMakeLists.txt +++ b/src/erasure-code/lrc/CMakeLists.txt @@ -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) diff --git a/src/test/crush/CMakeLists.txt b/src/test/crush/CMakeLists.txt index e6159c9ace8..0c7d7dca4d6 100644 --- a/src/test/crush/CMakeLists.txt +++ b/src/test/crush/CMakeLists.txt @@ -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 diff --git a/src/test/erasure-code/CMakeLists.txt b/src/test/erasure-code/CMakeLists.txt index 5a5f2ab65c0..1c4ca798433 100644 --- a/src/test/erasure-code/CMakeLists.txt +++ b/src/test/erasure-code/CMakeLists.txt @@ -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 ) |