From 400d6c1fd90a76080473493b7b02870ab51730ba Mon Sep 17 00:00:00 2001 From: Jesse Williamson Date: Thu, 10 May 2018 16:20:42 -0700 Subject: [PATCH] build: add top-level libraddosstriper conditional Signed-off-by: Jesse Williamson (cherry picked from commit 5513a90c62f506d251dfebb2c3a871480c36337a) --- src/include/config-h.in.cmake | 3 +++ src/test/CMakeLists.txt | 14 +++++++++----- src/test/libradosstriper/CMakeLists.txt | 3 +++ src/tools/CMakeLists.txt | 8 +++++++- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/include/config-h.in.cmake b/src/include/config-h.in.cmake index 66ecbfb3d7236..5ce4a2d4d167b 100644 --- a/src/include/config-h.in.cmake +++ b/src/include/config-h.in.cmake @@ -336,6 +336,9 @@ /* Defined if boost::context is available */ #cmakedefine HAVE_BOOST_CONTEXT +/* Defined if libradosstriper is enabled: */ +#cmakedefine WITH_LIBRADOSSTRIPER + /* Defined if OpenSSL is available for the rgw beast frontend */ #cmakedefine WITH_RADOSGW_BEAST_OPENSSL diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 892b87f76ec9e..0afc6827510ba 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -34,7 +34,9 @@ add_subdirectory(journal) add_subdirectory(libcephfs) add_subdirectory(librados) add_subdirectory(librados_test_stub) -add_subdirectory(libradosstriper) +if(WITH_LIBRADOSSTRIPER) + add_subdirectory(libradosstriper) +endif() if(WITH_RBD) add_subdirectory(librbd) endif(WITH_RBD) @@ -635,12 +637,14 @@ add_ceph_unittest(unittest_workqueue) target_link_libraries(unittest_workqueue global) # unittest_striper -add_executable(unittest_striper - test_striper.cc - $ - ) +if(WITH_LIBRADOSSTRIPER) + add_executable(unittest_striper + test_striper.cc + $ + ) add_ceph_unittest(unittest_striper) target_link_libraries(unittest_striper global ${BLKID_LIBRARIES}) +endif(WITH_LIBRADOSSTRIPER) # unittest_prebufferedstreambuf add_executable(unittest_prebufferedstreambuf diff --git a/src/test/libradosstriper/CMakeLists.txt b/src/test/libradosstriper/CMakeLists.txt index b328acb31bd78..be76b3d285457 100644 --- a/src/test/libradosstriper/CMakeLists.txt +++ b/src/test/libradosstriper/CMakeLists.txt @@ -1,3 +1,6 @@ +# +# Note: only compiled if WITH_LIBRADOSSTRIPER is defined. +# add_library(rados_striper_test STATIC TestCase.cc) target_link_libraries(rados_striper_test radostest) set_target_properties(rados_striper_test PROPERTIES COMPILE_FLAGS diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index e0844ec0c7a1f..49e6e32645e66 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -7,7 +7,13 @@ set(rados_srcs ${PROJECT_SOURCE_DIR}/src/common/obj_bencher.cc ${PROJECT_SOURCE_DIR}/src/osd/ECUtil.cc) add_executable(rados ${rados_srcs}) -target_link_libraries(rados librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} radosstriper) + +target_link_libraries(rados librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) +if(WITH_LIBRADOSSTRIPER) +target_link_libraries(rados radosstriper) +else() +target_link_libraries(rados cls_lock_client) +endif() install(TARGETS rados DESTINATION bin) if(WITH_TESTS) -- 2.39.5