build: add top-level libraddosstriper conditional

Signed-off-by: Jesse Williamson <jwilliamson@suse.de>
This commit is contained in:
Jesse Williamson 2018-05-10 16:20:42 -07:00
parent 2bec876995
commit 5513a90c62
4 changed files with 22 additions and 6 deletions

View File

@ -333,6 +333,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

View File

@ -33,7 +33,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)
@ -642,12 +644,14 @@ add_ceph_unittest(unittest_workqueue)
target_link_libraries(unittest_workqueue global)
# unittest_striper
add_executable(unittest_striper
test_striper.cc
$<TARGET_OBJECTS:unit-main>
)
if(WITH_LIBRADOSSTRIPER)
add_executable(unittest_striper
test_striper.cc
$<TARGET_OBJECTS:unit-main>
)
add_ceph_unittest(unittest_striper)
target_link_libraries(unittest_striper global ${BLKID_LIBRARIES})
endif(WITH_LIBRADOSSTRIPER)
# unittest_prebufferedstreambuf
add_executable(unittest_prebufferedstreambuf

View File

@ -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

View File

@ -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)