From: Kefu Chai Date: Fri, 13 Jan 2017 07:41:15 +0000 (+0800) Subject: cmake: link ceph-{mds,mgr,mon,osd} against libcommon X-Git-Tag: v12.0.0~87^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=4ea38df656b2aad9398fcb1656c294f5b8366811;p=ceph-ci.git cmake: link ceph-{mds,mgr,mon,osd} against libcommon add a static library named global-static, which does not link with libceph-common. so the executables which does not link against lib{rados,cephfs,rbd} can be linked against global-static instead if they want to access the symbols previously available from libglobal. and libglobal is now linked against libceph-common. and it is supposed to be used by executables packaged by ceph-test. these exectuables can safely depend on libceph-common offered by package of "librados2". Signed-off-by: Kefu Chai --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1dc54a78b55..86c93e2ff0f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -626,7 +626,7 @@ if (WITH_MGR) add_executable(ceph-mgr ${mgr_srcs} $) target_include_directories(ceph-mgr PRIVATE "${PYTHON_INCLUDE_DIRS}") - target_link_libraries(ceph-mgr mds osdc global + target_link_libraries(ceph-mgr mds osdc global-static common ${Boost_PYTHON_LIBRARY} ${PYTHON_LIBRARIES} ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS}) install(TARGETS ceph-mgr DESTINATION bin) endif (WITH_MGR) @@ -716,7 +716,8 @@ set(ceph_mon_srcs add_executable(ceph-mon ${ceph_mon_srcs} $) add_dependencies(ceph-mon erasure_code_plugins) - target_link_libraries(ceph-mon mon ceph-common os global ${EXTRALIBS} +target_link_libraries(ceph-mon mon common os global-static common + ${EXTRALIBS} ${CMAKE_DL_LIBS}) install(TARGETS ceph-mon DESTINATION bin) @@ -782,7 +783,8 @@ set(ceph_osd_srcs add_executable(ceph-osd ${ceph_osd_srcs} $) add_dependencies(ceph-osd erasure_code_plugins) -target_link_libraries(ceph-osd osd os global ${BLKID_LIBRARIES} ${RDMA_LIBRARIES}) +target_link_libraries(ceph-osd osd os global-static common + ${BLKID_LIBRARIES} ${RDMA_LIBRARIES}) if(WITH_FUSE) target_link_libraries(ceph-osd ${FUSE_LIBRARIES}) endif() @@ -793,7 +795,7 @@ set(ceph_mds_srcs ceph_mds.cc) add_executable(ceph-mds ${ceph_mds_srcs} $) -target_link_libraries(ceph-mds mds ${CMAKE_DL_LIBS} global +target_link_libraries(ceph-mds mds ${CMAKE_DL_LIBS} global-static common ${Boost_THREAD_LIBRARY}) install(TARGETS ceph-mds DESTINATION bin) @@ -897,7 +899,7 @@ if(WITH_LIBCEPHFS) ceph_syn.cc client/SyntheticClient.cc) add_executable(ceph-syn ${ceph_syn_srcs}) - target_link_libraries(ceph-syn client global) + target_link_libraries(ceph-syn client global-static) set(mount_ceph_srcs mount/mount.ceph.c) @@ -916,7 +918,8 @@ if(WITH_LIBCEPHFS) ceph_fuse.cc client/fuse_ll.cc) add_executable(ceph-fuse ${ceph_fuse_srcs}) - target_link_libraries(ceph-fuse ${ALLOC_LIBS} ${FUSE_LIBRARIES} client global) + target_link_libraries(ceph-fuse ${ALLOC_LIBS} ${FUSE_LIBRARIES} + client global-static) set_target_properties(ceph-fuse PROPERTIES COMPILE_FLAGS "-I${FUSE_INCLUDE_DIRS}") install(TARGETS ceph-fuse DESTINATION bin) install(PROGRAMS mount.fuse.ceph DESTINATION ${CMAKE_INSTALL_SBINDIR}) diff --git a/src/global/CMakeLists.txt b/src/global/CMakeLists.txt index 079d78bbc29..46de512f5c9 100644 --- a/src/global/CMakeLists.txt +++ b/src/global/CMakeLists.txt @@ -5,6 +5,13 @@ set(libglobal_srcs set(global_common_files global_context.cc) add_library(global_common_objs OBJECT ${global_common_files}) -add_library(global STATIC ${libglobal_srcs} +add_library(libglobal_objs OBJECT ${libglobal_srcs}) + +add_library(global-static STATIC + $ + $) + +add_library(global STATIC + $ $) target_link_libraries(global ceph-common ${DPDK_LIBRARIES} ${EXTRALIBS}) diff --git a/src/mds/CMakeLists.txt b/src/mds/CMakeLists.txt index d6f7645cdd7..72d370992a6 100644 --- a/src/mds/CMakeLists.txt +++ b/src/mds/CMakeLists.txt @@ -40,4 +40,4 @@ set(mds_srcs add_library(mds STATIC ${mds_srcs} $ $) -target_link_libraries(mds ${ALLOC_LIBS} osdc ceph-common liblua) +target_link_libraries(mds ${ALLOC_LIBS} osdc liblua)