Skip to content

Commit

Permalink
Merge PR ceph#26667 into master
Browse files Browse the repository at this point in the history
* refs/pull/26667/head:
	cmake: link rgw tests with ${rgw_libs}
	cmake: link ${rgw_libs} not rgw_a and rabbitmq
	cmake: move rgw tests targets down to end

Reviewed-by: Tim Serong <[email protected]>
Reviewed-by: Yuval Lifshitz <[email protected]>
Reviewed-by: Nathan Cutler <[email protected]>
  • Loading branch information
liewegas committed Mar 1, 2019
2 parents fa690ea + 8655f89 commit cac4335
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 40 deletions.
1 change: 1 addition & 0 deletions .githubmap
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,4 @@ hsiang41 Rick Chen <[email protected]>
djgalloway David Galloway <[email protected]>
Yan-waller yanjun <[email protected]>
b-ranto Boris Ranto <[email protected]>
yuvalif Yuval Lifshitz <[email protected]>
70 changes: 30 additions & 40 deletions src/rgw/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
if(WITH_TESTS)
add_executable(ceph_rgw_jsonparser
rgw_jsonparser.cc)
target_link_libraries(ceph_rgw_jsonparser
rgw_a
global rabbitmq)

add_executable(ceph_rgw_multiparser
rgw_multiparser.cc)
target_link_libraries(ceph_rgw_multiparser
rgw_a
global rabbitmq)

install(TARGETS
ceph_rgw_jsonparser
ceph_rgw_multiparser
DESTINATION bin)
endif(WITH_TESTS)

add_custom_target(civetweb_h
COMMAND ${CMAKE_COMMAND} -E make_directory
"${CMAKE_BINARY_DIR}/src/include/civetweb"
Expand Down Expand Up @@ -221,6 +202,12 @@ if(WITH_BOOST_CONTEXT)
target_link_libraries(rgw_a PRIVATE Boost::coroutine Boost::context)
endif()

set(rgw_libs rgw_a)
if(WITH_RADOSGW_AMQP_ENDPOINT)
# used by rgw_amqp.cc
list(APPEND rgw_libs RabbitMQ::RabbitMQ)
endif()

set(radosgw_srcs
rgw_loadgen_process.cc
rgw_civetweb.cc
Expand All @@ -239,15 +226,11 @@ endif()

add_library(radosgw_a STATIC ${radosgw_srcs}
$<TARGET_OBJECTS:civetweb_common_objs>)
target_link_libraries(radosgw_a PRIVATE rgw_a)
target_link_libraries(radosgw_a PRIVATE ${rgw_libs})
if(WITH_RADOSGW_BEAST_FRONTEND AND WITH_RADOSGW_BEAST_OPENSSL)
# used by rgw_asio_frontend.cc
target_link_libraries(radosgw_a PRIVATE OpenSSL::SSL)
endif()
if(WITH_RADOSGW_AMQP_ENDPOINT)
# used by rgw_amqp.cc
target_link_libraries(radosgw_a PRIVATE RabbitMQ::RabbitMQ)
endif()

add_executable(radosgw rgw_main.cc)
target_link_libraries(radosgw radosgw_a librados
Expand All @@ -264,29 +247,23 @@ set(radosgw_admin_srcs
rgw_admin.cc
rgw_orphan.cc)
add_executable(radosgw-admin ${radosgw_admin_srcs})
target_link_libraries(radosgw-admin rgw_a librados
target_link_libraries(radosgw-admin ${rgw_libs} librados
cls_rgw_client cls_otp_client cls_lock_client cls_refcount_client
cls_log_client cls_timeindex_client
cls_version_client cls_user_client
global ${FCGI_LIBRARY} ${LIB_RESOLV}
${CURL_LIBRARIES} ${EXPAT_LIBRARIES} ${BLKID_LIBRARIES})
if(WITH_RADOSGW_AMQP_ENDPOINT)
target_link_libraries(radosgw-admin RabbitMQ::RabbitMQ)
endif()
install(TARGETS radosgw-admin DESTINATION bin)

set(radosgw_es_srcs
rgw_es_main.cc)
add_executable(radosgw-es ${radosgw_es_srcs})
target_link_libraries(radosgw-es rgw_a librados
target_link_libraries(radosgw-es ${rgw_libs} librados
cls_rgw_client cls_otp_client cls_lock_client cls_refcount_client
cls_log_client cls_timeindex_client
cls_version_client cls_user_client
global ${FCGI_LIBRARY} ${LIB_RESOLV}
${CURL_LIBRARIES} ${EXPAT_LIBRARIES} ${BLKID_LIBRARIES})
if(WITH_RADOSGW_AMQP_ENDPOINT)
target_link_libraries(radosgw-es RabbitMQ::RabbitMQ)
endif()
install(TARGETS radosgw-es DESTINATION bin)

set(radosgw_token_srcs
Expand All @@ -299,15 +276,12 @@ install(TARGETS radosgw-token DESTINATION bin)
set(radosgw_object_expirer_srcs
rgw_object_expirer.cc)
add_executable(radosgw-object-expirer ${radosgw_object_expirer_srcs})
target_link_libraries(radosgw-object-expirer rgw_a librados
target_link_libraries(radosgw-object-expirer ${rgw_libs} librados
cls_rgw_client cls_otp_client cls_lock_client cls_refcount_client
cls_log_client cls_timeindex_client
cls_version_client cls_user_client
global ${FCGI_LIBRARY} ${LIB_RESOLV}
${CURL_LIBRARIES} ${EXPAT_LIBRARIES})
if(WITH_RADOSGW_AMQP_ENDPOINT)
target_link_libraries(radosgw-object-expirer RabbitMQ::RabbitMQ)
endif()
install(TARGETS radosgw-object-expirer DESTINATION bin)

set(librgw_srcs
Expand All @@ -317,7 +291,7 @@ add_library(rgw SHARED ${librgw_srcs})
target_link_libraries(rgw
PUBLIC dmclock::dmclock
PRIVATE
rgw_a
${rgw_libs}
librados
cls_rgw_client
cls_otp_client
Expand All @@ -331,9 +305,6 @@ target_link_libraries(rgw
${LIB_RESOLV}
${CURL_LIBRARIES}
${EXPAT_LIBRARIES})
if(WITH_RADOSGW_AMQP_ENDPOINT)
target_link_libraries(rgw PRIVATE RabbitMQ::RabbitMQ)
endif()
set_target_properties(rgw PROPERTIES OUTPUT_NAME rgw VERSION 2.0.0
SOVERSION 2)
install(TARGETS rgw DESTINATION ${CMAKE_INSTALL_LIBDIR})
Expand Down Expand Up @@ -372,3 +343,22 @@ endif()
if(WITH_BOOST_CONTEXT)
target_link_libraries(rgw_admin_user PRIVATE Boost::coroutine Boost::context)
endif()

if(WITH_TESTS)
add_executable(ceph_rgw_jsonparser
rgw_jsonparser.cc)
target_link_libraries(ceph_rgw_jsonparser
${rgw_libs}
global)

add_executable(ceph_rgw_multiparser
rgw_multiparser.cc)
target_link_libraries(ceph_rgw_multiparser
${rgw_libs}
global)

install(TARGETS
ceph_rgw_jsonparser
ceph_rgw_multiparser
DESTINATION bin)
endif(WITH_TESTS)

0 comments on commit cac4335

Please sign in to comment.