From 659ce77875e4c7a289bcf3c5956f43b269cc829f Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 23 Jun 2016 11:51:01 +0800 Subject: [PATCH] cmake: link libradostriper with librados_objs create an OBJECT target for libradostriper, so it is able to access the internal symbols of librados. Signed-off-by: Kefu Chai --- src/CMakeLists.txt | 6 ++++-- src/libradosstriper/CMakeLists.txt | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6b4bcd2252c..340d0adb57e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -548,12 +548,14 @@ set(librados_srcs librados/IoCtxImpl.cc librados/RadosXattrIter.cc ) -add_library(librados ${CEPH_SHARED} ${librados_srcs} +add_library(librados_objs OBJECT ${librados_srcs}) +add_library(librados ${CEPH_SHARED} + $ $ $) add_dependencies(librados osdc) if(WITH_LTTNG) - add_dependencies(librados rados-tp) + add_dependencies(librados_objs rados-tp) endif() # LINK_PRIVATE instead of PRIVATE is used to backward compatibility with cmake 2.8.11 target_link_libraries(librados LINK_PRIVATE osdc osd os global common cls_lock_client diff --git a/src/libradosstriper/CMakeLists.txt b/src/libradosstriper/CMakeLists.txt index 1a2170152f6..d93d03f0579 100644 --- a/src/libradosstriper/CMakeLists.txt +++ b/src/libradosstriper/CMakeLists.txt @@ -2,8 +2,10 @@ set(libradosstriper_srcs libradosstriper.cc RadosStriperImpl.cc MultiAioCompletionImpl.cc) -add_library(radosstriper ${CEPH_SHARED} ${libradosstriper_srcs}) -target_link_libraries(radosstriper librados cls_lock_client osdc common pthread ${CRYPTO_LIBS} ${EXTRALIBS}) +add_library(radosstriper ${CEPH_SHARED} + ${libradosstriper_srcs} + $) +target_link_libraries(radosstriper cls_lock_client osdc common pthread ${CRYPTO_LIBS} ${EXTRALIBS}) set_target_properties(radosstriper PROPERTIES OUPUT_NAME radosstriper VERSION 1.0.0 -- 2.39.5