From: Kefu Chai Date: Fri, 13 Jan 2017 07:35:20 +0000 (+0800) Subject: cmake: always build a static libceph-common X-Git-Tag: v12.0.0~87^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=77a7a1ebb4f626668637e8ea5d0f7e90f4d862bf;p=ceph.git cmake: always build a static libceph-common Signed-off-by: Kefu Chai --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index da71587fcf42..1dc54a78b559 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -544,16 +544,15 @@ else() endif() add_library(common-objs OBJECT ${libcommon_files}) -add_library(ceph-common SHARED +set(ceph_common_objs $ $ $ $ $ $) -set_target_properties(ceph-common PROPERTIES - INSTALL_RPATH "") -target_link_libraries(ceph-common json_spirit erasure_code rt ${LIB_RESOLV} +set(ceph_common_deps + json_spirit erasure_code rt ${LIB_RESOLV} ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_REGEX_LIBRARY} @@ -564,19 +563,7 @@ target_link_libraries(ceph-common json_spirit erasure_code rt ${LIB_RESOLV} ${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() -# appease dpkg-shlibdeps -set_target_properties(ceph-common PROPERTIES - SOVERSION 0) -install(TARGETS ceph-common DESTINATION ${CMAKE_INSTALL_PKGLIBDIR}) -if(WITH_EMBEDDED) - add_library(cephd_common STATIC - $ - $ - $ - $ - $) + list(APPEND ceph_common_deps ${ZLIB_LIBRARIES}) endif() set_source_files_properties(${CMAKE_SOURCE_DIR}/src/ceph_ver.c @@ -587,9 +574,20 @@ 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(ceph-common common_crc_aarch64) + list(APPEND ceph_common_deps common_crc_aarch64) endif(HAVE_ARMV8_CRC) +add_library(common STATIC ${ceph_common_objs}) +target_link_libraries(common ${ceph_common_deps}) + +add_library(ceph-common SHARED ${ceph_common_objs}) +target_link_libraries(ceph-common ${ceph_common_deps}) +# appease dpkg-shlibdeps +set_target_properties(ceph-common PROPERTIES + SOVERSION 0 + INSTALL_RPATH "") +install(TARGETS ceph-common DESTINATION ${CMAKE_INSTALL_PKGLIBDIR}) + add_library(common_utf8 STATIC common/utf8.c) if(${WITH_LTTNG}) diff --git a/src/libcephd/CMakeLists.txt b/src/libcephd/CMakeLists.txt index db387f28d10e..5ace601a15bd 100644 --- a/src/libcephd/CMakeLists.txt +++ b/src/libcephd/CMakeLists.txt @@ -17,7 +17,7 @@ set(merge_libs cephd_rados cephd_rbd cephd_rgw - cephd_common + common common_utf8 erasure_code global