diff options
author | Kefu Chai <kchai@redhat.com> | 2017-01-09 16:45:07 +0100 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2017-01-10 14:10:53 +0100 |
commit | 8f7643792c9e6a3d1ba4a06ca7d09b0de9af1443 (patch) | |
tree | 25d3f3f6c138c6935e17c5e1de833608845d7eb0 /src/librados/CMakeLists.txt | |
parent | Merge pull request #12854 from liupan1111/wip-fix-async-dpdk-issue (diff) | |
download | ceph-8f7643792c9e6a3d1ba4a06ca7d09b0de9af1443.tar.xz ceph-8f7643792c9e6a3d1ba4a06ca7d09b0de9af1443.zip |
cmake: turn libcommon into a shared library
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>
Diffstat (limited to 'src/librados/CMakeLists.txt')
-rw-r--r-- | src/librados/CMakeLists.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librados/CMakeLists.txt b/src/librados/CMakeLists.txt index 3db8ffe72fb..da9207e1a97 100644 --- a/src/librados/CMakeLists.txt +++ b/src/librados/CMakeLists.txt @@ -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 |