]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: turn libcommon into a shared library
authorKefu Chai <kchai@redhat.com>
Mon, 9 Jan 2017 15:45:07 +0000 (23:45 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 10 Jan 2017 13:10:53 +0000 (21:10 +0800)
prior to this change, libcommon is a convenient library which gets
linked into librados, librbd and libcephfs and all ceph executables.
this incurs some problems:
 - double dose of libcommon in memory space and HDD: waste of memory
   and disk space.
 - if an application links to two libraries including libcommon at the
   same time. take librados and libcephfs as an example, they could
   interfere with each other by changing the other guy's status.
after this change, libcommon is tuned into a shared library and
renamed to libceph-common. it will be installed into $prefix/lib/ceph,
and packaged in librados2.

ceph.spec.in,debian/librados2.install: package libceph-common in
  librados2.
CMakeLists.txt:
  - do not link against libboost-* if not necessary.
  - s/common/ceph-common/g
  - install libceph-common into $prefix/lib/ceph
  - set rpath to $prefix/lib/ceph
  - link against ceph-common if an executable needs access to non public
    symbols in ceph.

Signed-off-by: Kefu Chai <kchai@redhat.com>
29 files changed:
CMakeLists.txt
ceph.spec.in
debian/librados2.install
src/CMakeLists.txt
src/client/CMakeLists.txt
src/compressor/snappy/CMakeLists.txt
src/compressor/zlib/CMakeLists.txt
src/global/CMakeLists.txt
src/java/native/CMakeLists.txt
src/json_spirit/CMakeLists.txt
src/libcephd/CMakeLists.txt
src/librados/CMakeLists.txt
src/libradosstriper/CMakeLists.txt
src/librbd/CMakeLists.txt
src/mds/CMakeLists.txt
src/rbd_fuse/CMakeLists.txt
src/rbd_replay/CMakeLists.txt
src/rgw/CMakeLists.txt
src/test/CMakeLists.txt
src/test/ObjectMap/CMakeLists.txt
src/test/common/CMakeLists.txt
src/test/erasure-code/CMakeLists.txt
src/test/libcephfs/CMakeLists.txt
src/test/librados/CMakeLists.txt
src/test/librbd/CMakeLists.txt
src/test/mds/CMakeLists.txt
src/test/messenger/CMakeLists.txt
src/test/objectstore/CMakeLists.txt
src/tools/rbd/CMakeLists.txt

index 40c528d1cacb00e4e1efa3ea987416d4851d51ea..898e4abdbc5f9befa325c0cf9081889d6922abd2 100644 (file)
@@ -518,15 +518,6 @@ find_package(Boost 1.61 COMPONENTS ${BOOST_COMPONENTS} REQUIRED)
 include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
 include_directories(SYSTEM ${PROJECT_BINARY_DIR}/include)
 
-if (WITH_SYSTEM_BOOST)
-  if(FREEBSD)
-    # if boost_python is used then also link with libpython*
-    LIST(APPEND Boost_LIBRARIES ${PYTHON_LIBRARIES})
-  endif()
-else()
-  LIST(APPEND Boost_LIBRARIES "-lz")
-endif()
-
 CHECK_INCLUDE_FILE_CXX("boost/asio/coroutine.hpp" HAVE_BOOST_ASIO_COROUTINE)
 
 find_package(Threads REQUIRED)
index 5063ee43965791d954bce8fc4c950da1a4a8b37f..d673e85d974c91af65cec9945081f063fc421ee3 100644 (file)
@@ -1353,6 +1353,8 @@ fi
 %files -n librados2
 %defattr(-,root,root,-)
 %{_libdir}/librados.so.*
+%dir %{_libdir}/ceph
+%{_libdir}/ceph/libceph-common.so
 %if %{with lttng}
 %{_libdir}/librados_tp.so.*
 %endif
index 0bf6a71d512e75d37421ae3763d220e3d9235d3f..1d937e8d19e18ce1b642ad391128bd2025f3ed2e 100644 (file)
@@ -1,2 +1,3 @@
 usr/lib/librados.so.*
 usr/lib/librados_tp.so.*
+usr/lib/ceph/libceph-common.so
index 16342675815d704b64938100a871d20d643393cd..409981e575d1756f9bcc07fbd2b850cb5142480b 100644 (file)
@@ -5,6 +5,12 @@ include(GNUInstallDirs)
 # for erasure and compressor plugins
 set(CMAKE_INSTALL_PKGLIBDIR ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME})
 set(CMAKE_INSTALL_FULL_PKGLIBDIR ${CMAKE_INSTALL_FULL_LIBDIR}/${PROJECT_NAME})
+# so libceph-common can be found
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+if(NOT CMAKE_INSTALL_RPATH)
+  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_PKGLIBDIR}")
+endif()
+
 # to be compatible with configure_files shared with autoconfig
 set(bindir ${CMAKE_INSTALL_FULL_BINDIR})
 set(sbindir ${CMAKE_INSTALL_FULL_SBINDIR})
@@ -424,8 +430,6 @@ set(libcommon_files
   common/TrackedOp.cc
   common/SloppyCRCMap.cc
   common/types.cc
-  $<TARGET_OBJECTS:common_buffer_obj>
-  $<TARGET_OBJECTS:common_texttable_obj>
   log/Log.cc
   log/SubsystemMap.cc
   mon/MonCap.cc
@@ -503,7 +507,6 @@ set(libcommon_files
   common/dns_resolve.cc
   ${arch_files}
   ${auth_files}
-  $<TARGET_OBJECTS:compressor_objs>
   ${mds_files})
 if(LINUX)
   list(APPEND libcommon_files msg/async/EventEpoll.cc)
@@ -534,17 +537,36 @@ else()
     perfglue/disabled_stubs.cc)
 endif()
 
-if(ENABLE_SHARED)
-  list(APPEND libcommon_files
-    $<TARGET_OBJECTS:global_common_objs>)
-endif(ENABLE_SHARED)
-
-add_library(common STATIC ${libcommon_files}
-  $<TARGET_OBJECTS:mon_common_objs>
-  $<TARGET_OBJECTS:common_mountcephfs_objs>)
-target_link_libraries(common json_spirit erasure_code rt ${LIB_RESOLV}
-  ${Boost_LIBRARIES} ${BLKID_LIBRARIES} ${Backtrace_LIBRARIES}
+add_library(common-objs OBJECT ${libcommon_files})
+add_library(ceph-common SHARED
+  $<TARGET_OBJECTS:common_buffer_obj>
+  $<TARGET_OBJECTS:common_texttable_obj>
+  $<TARGET_OBJECTS:compressor_objs>
+  $<TARGET_OBJECTS:common-objs>
+  $<TARGET_OBJECTS:common_mountcephfs_objs>
+  $<TARGET_OBJECTS:global_common_objs>)
+target_link_libraries(ceph-common json_spirit erasure_code rt ${LIB_RESOLV}
+  ${Boost_THREAD_LIBRARY}
+  ${Boost_SYSTEM_LIBRARY}
+  ${Boost_REGEX_LIBRARY}
+  ${Boost_RANDOM_LIBRARY}
+  ${Boost_PROGRAM_OPTIONS_LIBRARY}
+  ${Boost_DATE_TIME_LIBRARY}
+  ${Boost_IOSTREAMS_LIBRARY}
+  ${BLKID_LIBRARIES} ${Backtrace_LIBRARIES}
   ${CRYPTO_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
+if(NOT WITH_SYSTEM_BOOST)
+  target_link_libraries(ceph-common ${ZLIB_LIBRARIES})
+endif()
+install(TARGETS ceph-common DESTINATION ${CMAKE_INSTALL_PKGLIBDIR})
+if(WITH_EMBEDDED)
+  add_library(cephd_common STATIC
+    $<TARGET_OBJECTS:common_buffer_obj>
+    $<TARGET_OBJECTS:common_texttable_obj>
+    $<TARGET_OBJECTS:compressor_objs>
+    $<TARGET_OBJECTS:common-objs>
+    $<TARGET_OBJECTS:common_mountcephfs_objs>)
+endif()
 
 set_source_files_properties(${CMAKE_SOURCE_DIR}/src/ceph_ver.c
   ${CMAKE_SOURCE_DIR}/src/common/version.cc
@@ -554,7 +576,7 @@ set_source_files_properties(${CMAKE_SOURCE_DIR}/src/ceph_ver.c
 include(SIMDExt)
 if(HAVE_ARMV8_CRC)
   add_library(common_crc_aarch64 STATIC common/crc32c_aarch64.c)
-  target_link_libraries(common common_crc_aarch64)
+  target_link_libraries(ceph-common common_crc_aarch64)
 endif(HAVE_ARMV8_CRC)
 
 add_library(common_utf8 STATIC common/utf8.c)
@@ -681,7 +703,7 @@ set(ceph_mon_srcs
 add_executable(ceph-mon ${ceph_mon_srcs}
   $<TARGET_OBJECTS:common_texttable_obj>)
 add_dependencies(ceph-mon erasure_code_plugins)
-      target_link_libraries(ceph-mon mon common os global ${EXTRALIBS}
+      target_link_libraries(ceph-mon mon ceph-common os global ${EXTRALIBS}
   ${CMAKE_DL_LIBS})
 install(TARGETS ceph-mon DESTINATION bin)
 
@@ -841,7 +863,7 @@ if(WITH_LIBCEPHFS)
   target_link_libraries(cephfs LINK_PRIVATE client
     ${CRYPTO_LIBS} ${EXTRALIBS})
   if(ENABLE_SHARED)
-    foreach(name common client osdc)
+    foreach(name ceph-common client osdc)
       set(CEPHFS_LINK_FLAGS "${CEPHFS_LINK_FLAGS} -Wl,--exclude-libs,lib${name}.a")
     endforeach()
     set_target_properties(cephfs PROPERTIES
index e3e2afabd0bff31f269f2bb166227c265dce53a4..7ec96e83ab040479658085a3fc1087ef487fd283 100644 (file)
@@ -8,4 +8,4 @@ set(libclient_srcs
   Trace.cc
   posix_acl.cc)
 add_library(client STATIC ${libclient_srcs})
-target_link_libraries(client common osdc)
+target_link_libraries(client ceph-common osdc)
index 108aea204020a45f1f19cade62dcf6ac1fb75a43..e76f0220fee0d18a258b4ae908cf8ab6ad0032e3 100644 (file)
@@ -6,7 +6,7 @@ set(snappy_sources
 
 add_library(ceph_snappy SHARED ${snappy_sources})
 add_dependencies(ceph_snappy ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
-target_link_libraries(ceph_snappy snappy common)
+target_link_libraries(ceph_snappy snappy)
 set_target_properties(ceph_snappy PROPERTIES VERSION 2.0.0 SOVERSION 2)
 install(TARGETS ceph_snappy DESTINATION ${compressor_plugin_dir})
 
index 19a84da51a54f607a0b00369e99290aab5535ec4..47efffb1177ee418e1acb4b0bcf19c44b1ac6499 100644 (file)
@@ -29,7 +29,7 @@ endif(HAVE_INTEL_SSE4_1 AND HAVE_BETTER_YASM_ELF64)
 
 add_library(ceph_zlib SHARED ${zlib_sources})
 add_dependencies(ceph_zlib ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
-target_link_libraries(ceph_zlib z common)
+target_link_libraries(ceph_zlib z)
 target_include_directories(ceph_zlib PRIVATE "${CMAKE_SOURCE_DIR}/src/isa-l/include")
 set_target_properties(ceph_zlib PROPERTIES VERSION 2.0.0 SOVERSION 2)
 install(TARGETS ceph_zlib DESTINATION ${compressor_plugin_dir})
index 90bb2a5e112d0e2e77d76c7b4b8072fd7a9ab1dd..079d78bbc2966e418bad8d741185abc3a956235b 100644 (file)
@@ -7,4 +7,4 @@ set(global_common_files
 add_library(global_common_objs OBJECT ${global_common_files})
 add_library(global STATIC ${libglobal_srcs}
   $<TARGET_OBJECTS:global_common_objs>)
-target_link_libraries(global common ${DPDK_LIBRARIES} ${EXTRALIBS})
+target_link_libraries(global ceph-common ${DPDK_LIBRARIES} ${EXTRALIBS})
index b3179d4c72c6d988cbec0b7c673fa1e128363f09..d7d633b3d7ecd4975fef050a5466ba885139711a 100644 (file)
@@ -8,6 +8,7 @@ set_target_properties(cephfs_jni PROPERTIES
   SOVERSION 1)
 add_dependencies(cephfs_jni jni-header)
 include_directories(${JNI_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
-target_link_libraries(cephfs_jni LINK_PRIVATE cephfs common ${EXTRALIBS} ${JNI_LIBRARIES})
+target_link_libraries(cephfs_jni LINK_PRIVATE cephfs ceph-common
+  ${EXTRALIBS} ${JNI_LIBRARIES})
 install(TARGETS cephfs_jni
   DESTINATION ${CMAKE_INSTALL_LIBDIR})
index 8abb56272426a8fad60649e8afdc52504da6408f..b3b5ce2e6f23e0578df34693606b93c490659504 100644 (file)
@@ -1,4 +1,4 @@
 add_library(json_spirit STATIC
   json_spirit_reader.cpp
   json_spirit_writer.cpp)
-target_link_libraries(json_spirit ${Boost_LIBRARIES} common_utf8)
+target_link_libraries(json_spirit common_utf8)
index 25d90c2dee31a4105d502ce8045a1d5503f9d9ee..b5e398f0fb93e8896d7f172ef1c524f74872cc45 100644 (file)
@@ -15,7 +15,7 @@ set(merge_libs
   cephd_cls_kvs
   cephd_rados
   cephd_rbd
-  common
+  cephd_common
   common_utf8
   erasure_code
   global
index 3db8ffe72fbbc2f076536909fe3da7da9973f038..da9207e1a9782117ab508d8f421d80a063d4cedd 100644 (file)
@@ -8,7 +8,7 @@ add_library(rados_a STATIC
   $<TARGET_OBJECTS:librados_api_obj>
   $<TARGET_OBJECTS:librados_objs>
   $<TARGET_OBJECTS:common_buffer_obj>)
-target_link_libraries(rados_a osdc common cls_lock_client
+target_link_libraries(rados_a osdc ceph-common cls_lock_client
     ${BLKID_LIBRARIES} ${CRYPTO_LIBS} ${EXTRALIBS})
 if(WITH_LTTNG)
   add_dependencies(librados_api_obj librados-tp)
@@ -19,7 +19,7 @@ if(ENABLE_SHARED)
     $<TARGET_OBJECTS:librados_objs>
     $<TARGET_OBJECTS:common_buffer_obj>)
   # LINK_PRIVATE instead of PRIVATE is used to backward compatibility with cmake 2.8.11
-  target_link_libraries(librados LINK_PRIVATE osdc common cls_lock_client
+  target_link_libraries(librados LINK_PRIVATE osdc ceph-common cls_lock_client
     ${BLKID_LIBRARIES} ${CRYPTO_LIBS} ${EXTRALIBS})
   set_target_properties(librados PROPERTIES
     OUTPUT_NAME rados
index 35b64ffbfdda532c339d06328ad19272835afcc9..5372a6d115deccaf101323051df9d6eae831ef36 100644 (file)
@@ -5,7 +5,7 @@ set(libradosstriper_srcs
 add_library(radosstriper ${CEPH_SHARED}
   ${libradosstriper_srcs}
   $<TARGET_OBJECTS:librados_objs>)
-target_link_libraries(radosstriper librados cls_lock_client osdc common pthread ${CRYPTO_LIBS} ${EXTRALIBS})
+target_link_libraries(radosstriper librados cls_lock_client osdc ceph-common pthread ${CRYPTO_LIBS} ${EXTRALIBS})
 set_target_properties(radosstriper PROPERTIES
   OUPUT_NAME radosstriper
   VERSION 1.0.0
index 6a10ce78261e5cdc4f622864a2f96ede88847f4f..847540322f97a251ef2561de3d92d4221d5e8373 100644 (file)
@@ -107,7 +107,7 @@ target_link_libraries(librbd LINK_PRIVATE
   cls_rbd_client 
   cls_lock_client 
   cls_journal_client 
-  common
+  ceph-common
   pthread
   ${CMAKE_DL_LIBS}
   ${EXTRALIBS})
index 0069ff089bcb538fe77d8446d2fb89a64fdd5886..d6f7645cdd793879ea5339f59ead00d27c4a71ac 100644 (file)
@@ -40,4 +40,4 @@ set(mds_srcs
 add_library(mds STATIC ${mds_srcs}
   $<TARGET_OBJECTS:heap_profiler_objs>
   $<TARGET_OBJECTS:common_util_obj>)
-target_link_libraries(mds ${ALLOC_LIBS} osdc common liblua)
+target_link_libraries(mds ${ALLOC_LIBS} osdc ceph-common liblua)
index 61a02d3ad0e8ff1bfbe67a22b785a2a566d946dc..618992b776a1d876708f4c166cd98d45efb1def2 100644 (file)
@@ -1,5 +1,5 @@
 add_executable(rbd-fuse
   rbd-fuse.cc)
 target_link_libraries(rbd-fuse
-  librbd librados common ${FUSE_LIBRARIES})
+  ceph-common librbd librados ${FUSE_LIBRARIES})
 install(TARGETS rbd-fuse DESTINATION bin)
index e745e894750be40c0a39376bc352c09eeff5d445..a842960a62f2b8f2d2906138f201409d215cb943 100644 (file)
@@ -15,7 +15,7 @@ target_link_libraries(rbd_replay LINK_PRIVATE librbd librados global)
 add_executable(rbd-replay
   rbd-replay.cc)
 target_link_libraries(rbd-replay
-  librbd librados global rbd_replay rbd_replay_types common)
+  librbd librados global rbd_replay rbd_replay_types ceph-common)
 install(TARGETS rbd-replay DESTINATION bin)
 
 set(librbd_replay_ios_srcs
@@ -32,7 +32,7 @@ if(${WITH_BABELTRACE})
     rbd_replay_types
     librbd
     librados
-    common
+    ceph-common
     global
     babeltrace
     babeltrace-ctf
index 768331ccb74185e459c016b0de3257cf6ad6680e..2ba6267326e47554782f63dc57317e30ae578024 100644 (file)
@@ -111,7 +111,7 @@ target_include_directories(rgw_a PUBLIC
 
 target_link_libraries(rgw_a librados cls_lock_client cls_rgw_client cls_refcount_client
   cls_log_client cls_statelog_client cls_timeindex_client cls_version_client
-  cls_replica_log_client cls_user_client common common_utf8 global
+  cls_replica_log_client cls_user_client ceph-common common_utf8 global
   ${CURL_LIBRARIES}
   ${EXPAT_LIBRARIES}
   ${OPENLDAP_LIBRARIES} ${CRYPTO_LIBS})
index 4079cbbe7c39fe48f7d095cbf8aeea8073c064b8..c43a1abf0de42c7814d5554ed57102cf4784285c 100644 (file)
@@ -76,7 +76,7 @@ target_link_libraries(ceph_test_signal_handlers global ${BLKID_LIBRARIES} ${CMAK
 add_executable(ceph_test_rewrite_latency
   test_rewrite_latency.cc
   )
-target_link_libraries(ceph_test_rewrite_latency common
+target_link_libraries(ceph_test_rewrite_latency ceph-common
   ${CMAKE_DL_LIBS}
   ${CMAKE_THREAD_LIBS_INIT} ${CRYPTO_LIBS} m ${EXTRALIBS})
 
@@ -94,7 +94,7 @@ target_link_libraries(test_crypto
   )
 
 add_executable(test_build_libcommon buildtest_skeleton.cc)
-target_link_libraries(test_build_libcommon common pthread ${CRYPTO_LIBS} ${EXTRALIBS})
+target_link_libraries(test_build_libcommon ceph-common pthread ${CRYPTO_LIBS} ${EXTRALIBS})
 
 if(WITH_RADOSGW)
   add_executable(test_build_librgw buildtest_skeleton.cc)
@@ -108,7 +108,7 @@ if(WITH_LIBCEPHFS)
 endif(WITH_LIBCEPHFS)
 
 add_executable(test_build_librados buildtest_skeleton.cc)
-target_link_libraries(test_build_librados librados pthread ${CRYPTO_LIBS} ${EXTRALIBS} osdc osd os common cls_lock_client ${BLKID_LIBRARIES})
+target_link_libraries(test_build_librados librados pthread ${CRYPTO_LIBS} ${EXTRALIBS} osdc osd os ceph-common cls_lock_client ${BLKID_LIBRARIES})
 
 # bench_log
 set(bench_log_srcs
@@ -278,6 +278,7 @@ target_include_directories(ceph_test_librgw_file PRIVATE ${FCGI_INCLUDE_DIR})
 target_link_libraries(ceph_test_librgw_file
   rgw
   librados
+  ceph-common
   ${UNITTEST_LIBS}
   ${EXTRALIBS}
   )
@@ -291,6 +292,7 @@ set_target_properties(ceph_test_librgw_file_cd PROPERTIES COMPILE_FLAGS
 target_link_libraries(ceph_test_librgw_file_cd
   rgw
   librados
+  ceph-common
   ${UNITTEST_LIBS}
   ${EXTRALIBS}
   )
@@ -304,6 +306,7 @@ set_target_properties(ceph_test_librgw_file_gp PROPERTIES COMPILE_FLAGS
 target_link_libraries(ceph_test_librgw_file_gp
   rgw
   librados
+  ceph-common
   ${UNITTEST_LIBS}
   ${EXTRALIBS}
   )
@@ -318,7 +321,7 @@ target_include_directories(ceph_test_librgw_file_nfsns PRIVATE ${FCGI_INCLUDE_DI
 target_link_libraries(ceph_test_librgw_file_nfsns
   rgw
   librados
-  boost_system
+  ceph-common
   ${UNITTEST_LIBS}
   ${EXTRALIBS}
   )
@@ -332,6 +335,7 @@ set_target_properties(ceph_test_librgw_file_aw PROPERTIES COMPILE_FLAGS
 target_link_libraries(ceph_test_librgw_file_aw
   rgw
   librados
+  ceph-common
   ${UNITTEST_LIBS}
   ${EXTRALIBS}
   )
@@ -359,9 +363,8 @@ set_target_properties(test_rgw_ldap PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(test_rgw_ldap
   librados
-  common
+  ceph-common
   ${OPENLDAP_LIBRARIES}
-  ${Boost_LIBRARIES}
   ${UNITTEST_LIBS}
   )
 
@@ -398,7 +401,7 @@ set_target_properties(ceph_xattr_bench PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(ceph_xattr_bench
   os
-  common
+  ceph-common
   ${UNITTEST_LIBS}
   global
   ${EXTRALIBS}
@@ -423,7 +426,7 @@ set_target_properties(ceph_test_filejournal PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(ceph_test_filejournal
   os
-  common
+  ceph-common
   ${UNITTEST_LIBS}
   global
   ${EXTRALIBS}
@@ -497,7 +500,7 @@ if(HAVE_BLKID)
     test_get_blkdev_size.cc
     )
   target_link_libraries(ceph_test_get_blkdev_size
-    common
+    ceph-common
     pthread
     ${EXTRALIBS}
     ${BLKID_LIBRARIES}
@@ -595,14 +598,14 @@ add_executable(unittest_encoding
   encoding.cc
   )
 add_ceph_unittest(unittest_encoding ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_encoding)
-target_link_libraries(unittest_encoding common librados ${XIO_LIBRARY} pthread rt m ${BLKID_LIBRARIES})
+target_link_libraries(unittest_encoding ceph-common librados ${XIO_LIBRARY} pthread rt m ${BLKID_LIBRARIES})
 
 # unittest_addrs
 add_executable(unittest_addrs
   test_addrs.cc
   )
 add_ceph_unittest(unittest_addrs ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_addrs)
-target_link_libraries(unittest_addrs common librados ${XIO_LIBRARY} pthread rt m ${BLKID_LIBRARIES})
+target_link_libraries(unittest_addrs ceph-common librados ${XIO_LIBRARY} pthread rt m ${BLKID_LIBRARIES})
 
 # unittest_workqueue
 add_executable(unittest_workqueue
@@ -704,7 +707,7 @@ add_executable(unittest_xlist
   test_xlist.cc
   )
 add_ceph_unittest(unittest_xlist ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_xlist)
-target_link_libraries(unittest_xlist common ${XIO_LIBRARY})
+target_link_libraries(unittest_xlist ceph-common ${XIO_LIBRARY})
 
 # unittest_arch
 add_executable(unittest_arch
@@ -798,7 +801,7 @@ add_executable(unittest_heartbeatmap
   $<TARGET_OBJECTS:unit-main>
   )
 add_ceph_unittest(unittest_heartbeatmap ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_heartbeatmap)
-target_link_libraries(unittest_heartbeatmap common global)
+target_link_libraries(unittest_heartbeatmap global ceph-common)
 
 if(${WITH_RADOSGW})
   # unittest_formatter
@@ -817,7 +820,7 @@ add_executable(unittest_daemon_config
   )
 add_ceph_unittest(unittest_daemon_config ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_daemon_config)
 target_link_libraries(unittest_daemon_config
-  common
+  ceph-common
   global
   ${BLKID_LIBRARIES}
   ${EXTRALIBS}
index 2a37b5acb2600f805dc0b2289e4c3099fc673105..9313e4303710f9c96299a7a81a9c09bd6729530a 100644 (file)
@@ -7,7 +7,7 @@ set_target_properties(ceph_test_object_map PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(ceph_test_object_map
   os
-  common
+  ceph-common
   ${UNITTEST_LIBS}
   global
   ${EXTRALIBS}
@@ -22,7 +22,7 @@ set_target_properties(ceph_test_keyvaluedb_atomicity PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(ceph_test_keyvaluedb_atomicity
   os
-  common
+  ceph-common
   ${UNITTEST_LIBS}
   global
   ${EXTRALIBS}
@@ -38,7 +38,7 @@ set_target_properties(ceph_test_keyvaluedb_iterators PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(ceph_test_keyvaluedb_iterators
   os
-  common
+  ceph-common
   ${UNITTEST_LIBS}
   global
   ${EXTRALIBS}
index 2a72cff8c53956e02083eab1818edec8214f3ca2..f8ebe478089e01ca754aff5cbf0fe767498145c6 100644 (file)
@@ -47,7 +47,7 @@ add_executable(unittest_str_map
   test_str_map.cc
   )
 add_ceph_unittest(unittest_str_map ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_str_map)
-target_link_libraries(unittest_str_map common global ${BLKID_LIBRARIES})
+target_link_libraries(unittest_str_map ceph-common global ${BLKID_LIBRARIES})
 
 # unittest_sharedptr_registry
 add_executable(unittest_sharedptr_registry
index ef48d668db03906febc40429f6914fef04b199d5..24f4fdf70950edd1861d396195fc9a523f315ab8 100644 (file)
@@ -6,15 +6,15 @@ add_ceph_test(test-erasure-code.sh ${CMAKE_CURRENT_SOURCE_DIR}/test-erasure-code
 add_executable(ceph_erasure_code_benchmark 
   ${CMAKE_SOURCE_DIR}/src/erasure-code/ErasureCode.cc
   ceph_erasure_code_benchmark.cc)
-target_link_libraries(ceph_erasure_code_benchmark common ${Boost_PROGRAM_OPTIONS_LIBRARY} global ${CMAKE_DL_LIBS})
+target_link_libraries(ceph_erasure_code_benchmark ceph-common ${Boost_PROGRAM_OPTIONS_LIBRARY} global ${CMAKE_DL_LIBS})
 install(TARGETS ceph_erasure_code_benchmark
   DESTINATION bin)
 
 add_executable(ceph_erasure_code_non_regression ceph_erasure_code_non_regression.cc)
-target_link_libraries(ceph_erasure_code_non_regression common ${Boost_PROGRAM_OPTIONS_LIBRARY} global ${CMAKE_DL_LIBS})
+target_link_libraries(ceph_erasure_code_non_regression ceph-common ${Boost_PROGRAM_OPTIONS_LIBRARY} global ${CMAKE_DL_LIBS})
 
 add_executable(ceph_erasure_code ceph_erasure_code.cc)
-target_link_libraries(ceph_erasure_code common ${Boost_PROGRAM_OPTIONS_LIBRARY} global ${CMAKE_DL_LIBS})
+target_link_libraries(ceph_erasure_code ceph-common ${Boost_PROGRAM_OPTIONS_LIBRARY} global ${CMAKE_DL_LIBS})
 install(TARGETS ceph_erasure_code
   DESTINATION bin)
 
@@ -55,7 +55,7 @@ target_link_libraries(unittest_erasure_code_plugin
   global
   ${CMAKE_DL_LIBS}
   ec_example
-  common
+  ceph-common
   )
 add_dependencies(unittest_erasure_code_plugin
   ec_example
@@ -74,7 +74,7 @@ add_executable(unittest_erasure_code
 add_ceph_unittest(unittest_erasure_code ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code)
 target_link_libraries(unittest_erasure_code
   global
-  common
+  ceph-common
   )
 
 # unittest_erasure_code_plugin_jerasure
@@ -85,7 +85,7 @@ add_executable(unittest_erasure_code_plugin_jerasure
 add_ceph_unittest(unittest_erasure_code_plugin_jerasure ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_plugin_jerasure)
 target_link_libraries(unittest_erasure_code_plugin_jerasure
   global
-  common)
+  ceph-common)
 add_dependencies(unittest_erasure_code_plugin_jerasure
   ec_jerasure)
 
@@ -100,7 +100,7 @@ add_executable(unittest_erasure_code_isa
 add_ceph_unittest(unittest_erasure_code_isa ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_isa)
 target_link_libraries(unittest_erasure_code_isa
   global
-  common
+  ceph-common
   ec_isa
   erasure_code
   )
@@ -114,7 +114,7 @@ add_executable(unittest_erasure_code_plugin_isa
 add_ceph_unittest(unittest_erasure_code_plugin_isa ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_plugin_isa)
 target_link_libraries(unittest_erasure_code_plugin_isa
   global
-  common
+  ceph-common
   crush
   ${CMAKE_DL_LIBS}
   erasure_code
@@ -132,7 +132,7 @@ target_link_libraries(unittest_erasure_code_lrc
   global
   ${CMAKE_DL_LIBS}
   ec_lrc
-  common
+  ceph-common
   )
 
 # unittest_erasure_code_plugin_lrc
@@ -147,7 +147,7 @@ add_dependencies(unittest_erasure_code_plugin_lrc
 target_link_libraries(unittest_erasure_code_plugin_lrc
   global
   ${CMAKE_DL_LIBS}
-  common)
+  ceph-common)
 
 # unittest_erasure_code_plugin_shec
 add_executable(unittest_erasure_code_plugin_shec
@@ -158,7 +158,7 @@ add_ceph_unittest(unittest_erasure_code_plugin_shec ${CMAKE_RUNTIME_OUTPUT_DIREC
 target_link_libraries(unittest_erasure_code_plugin_shec
   global
   ${CMAKE_DL_LIBS}
-  common)
+  ceph-common)
 add_dependencies(unittest_erasure_code_plugin_shec 
   ec_shec)
 
@@ -172,7 +172,7 @@ add_ceph_unittest(unittest_erasure_code_example ${CMAKE_RUNTIME_OUTPUT_DIRECTORY
 target_link_libraries(unittest_erasure_code_example
   global
   ${CMAKE_DL_LIBS}
-  common
+  ceph-common
   erasure_code
   ${UNITTEST_LIBS}
   )
@@ -189,7 +189,7 @@ add_executable(unittest_erasure_code_jerasure
 add_ceph_unittest(unittest_erasure_code_jerasure ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_jerasure)
 target_link_libraries(unittest_erasure_code_jerasure
   global
-  common
+  ceph-common
   ec_jerasure
   )
 
@@ -205,7 +205,7 @@ add_ceph_unittest(unittest_erasure_code_shec ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/u
 target_link_libraries(unittest_erasure_code_shec
   global
   ${CMAKE_DL_LIBS}
-  common
+  ceph-common
   ec_shec
   )
 
@@ -217,7 +217,7 @@ add_ceph_unittest(unittest_erasure_code_shec_all ${CMAKE_RUNTIME_OUTPUT_DIRECTOR
 target_link_libraries(unittest_erasure_code_shec_all
   global
   ${CMAKE_DL_LIBS}
-  common
+  ceph-common
   ec_shec
   )
 
@@ -230,7 +230,7 @@ add_ceph_unittest(unittest_erasure_code_shec_thread ${CMAKE_RUNTIME_OUTPUT_DIREC
 target_link_libraries(unittest_erasure_code_shec_thread
   global
   ${CMAKE_DL_LIBS}
-  common
+  ceph-common
   ec_shec
   )
 
@@ -243,6 +243,6 @@ add_ceph_unittest(unittest_erasure_code_shec_arguments ${CMAKE_RUNTIME_OUTPUT_DI
 target_link_libraries(unittest_erasure_code_shec_arguments
   global
   ${CMAKE_DL_LIBS}
-  common
+  ceph-common
   ec_shec
   )
index ace1c882d5a664235342bea761039b93a908313e..2e42c03f0685e0238c0ef8396cca5e8ccbbaebfc 100644 (file)
@@ -27,6 +27,7 @@ if(${WITH_CEPHFS})
   set_target_properties(ceph_test_libcephfs_access PROPERTIES COMPILE_FLAGS
     ${UNITTEST_CXX_FLAGS})
   target_link_libraries(ceph_test_libcephfs_access
+    ceph-common
     cephfs
     librados
     ${UNITTEST_LIBS}
index aef20ba34b213c43e93b92634fb28cbcc0faad4c..60939020f60b5916857d3b52e4fa165d1290633f 100644 (file)
@@ -3,7 +3,7 @@ set(libradostest_srcs
   test.cc 
   TestCase.cc)
 add_library(radostest STATIC ${libradostest_srcs})
-target_link_libraries(radostest common json_spirit ${EXTRALIBS})
+target_link_libraries(radostest ceph-common json_spirit ${EXTRALIBS})
 set_target_properties(radostest PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 
 # ceph_test_rados_api_cmd
index f58e2950e54078ce6b8c44729f446f80bbd78f4e..3fb3dde8f9d0ade48ee9360ab0bc2eb123ae54b0 100644 (file)
@@ -114,7 +114,7 @@ add_executable(ceph_test_librbd_api
 target_link_libraries(ceph_test_librbd_api
   librbd
   librados
-  common
+  ceph-common
   radostest
   ${UNITTEST_LIBS})
 set_target_properties(ceph_test_librbd_api PROPERTIES COMPILE_FLAGS
index 09f9e7b20abc3dcd3eaef23e56bd355fc2e5e359..24c678e6081087ab2edf647f89819dd18b0ae4a3 100644 (file)
@@ -13,5 +13,5 @@ add_executable(unittest_mds_sessionfilter
   $<TARGET_OBJECTS:unit-main>
   )
 add_ceph_unittest(unittest_mds_sessionfilter ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_mds_sessionfilter)
-target_link_libraries(unittest_mds_sessionfilter mds osdc common global ${BLKID_LIBRARIES})
+target_link_libraries(unittest_mds_sessionfilter mds osdc ceph-common global ${BLKID_LIBRARIES})
 
index afe7b703e61eee5e760ee78b2eafe9dd57c6dd8c..c1b7c3a3ae1550e3eae81a3eba7718a285d93a5b 100644 (file)
@@ -3,7 +3,7 @@ add_executable(simple_server
   simple_dispatcher.cc
   )
 target_link_libraries(simple_server
-  os global common ${Boost_REGEX_LIBRARY}
+  os global ceph-common
   ${EXTRALIBS}
   ${CMAKE_DL_LIBS}
   )
@@ -13,7 +13,7 @@ add_executable(simple_client
   simple_dispatcher.cc
   )
 target_link_libraries(simple_client
-  os global common ${Boost_REGEX_LIBRARY}
+  os global ceph-common
   ${EXTRALIBS}
   ${CMAKE_DL_LIBS}
   )
@@ -24,7 +24,7 @@ if(HAVE_XIO)
     xio_dispatcher.cc
     )
   target_link_libraries(xio_server
-    os global common ${Boost_REGEX_LIBRARY}
+    os global ceph-common
     ${XIO_LIBRARY} pthread rt
     ${EXTRALIBS}
     ${CMAKE_DL_LIBS}
@@ -35,7 +35,7 @@ if(HAVE_XIO)
     xio_dispatcher.cc
     )
   target_link_libraries(xio_client
-    os global common ${Boost_REGEX_LIBRARY}
+    os global ceph-common
     ${XIO_LIBRARY} pthread rt
     ${EXTRALIBS}
     ${CMAKE_DL_LIBS}
index d19264e7d2ecc516898c97c83e96b0ac359be1b0..71248d1acc7d01d78abe9856f924d843aa00097e 100644 (file)
@@ -20,7 +20,7 @@ set_target_properties(ceph_test_objectstore PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(ceph_test_objectstore
   os
-  common
+  ceph-common
   ${UNITTEST_LIBS}
   global
   ${EXTRALIBS}
@@ -38,7 +38,7 @@ set_target_properties(ceph_test_keyvaluedb PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(ceph_test_keyvaluedb
   os
-  common
+  ceph-common
   ${UNITTEST_LIBS}
   global
   ${EXTRALIBS}
@@ -142,7 +142,7 @@ endif(HAVE_LIBAIO)
 add_executable(unittest_transaction
   test_transaction.cc)
 add_ceph_unittest(unittest_transaction ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_transaction)
-target_link_libraries(unittest_transaction os common ${XIO_LIBRARY})
+target_link_libraries(unittest_transaction os ceph-common ${XIO_LIBRARY})
 
 # unittest_memstore_clone
 add_executable(unittest_memstore_clone
index cc96fb8f604e5137d9ac0c23a1f81604aafcf9c8..7b1c9dc70680102068712c67c97ef0da1fef0cd8 100644 (file)
@@ -45,7 +45,7 @@ target_link_libraries(rbd librbd librados
   krbd
   rbd_types
   journal
-  common global
+  ceph-common global
   ${Boost_REGEX_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}
   ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
 install(TARGETS rbd DESTINATION bin)