Skip to content

Commit

Permalink
cmake: do not link against boost in a wholesale
Browse files Browse the repository at this point in the history
The only thing in RGW that should depend on Boost (::coroutine, ::context)
libraries is the boost/asio/spawn.hpp header used by rgw_asio_frontend.cc

Use the target_link_libraries(<target> <item>...) [1] syntax to ensure that the
library dependencies are transitive: i.e. "when this target is linked into
another target then the libraries linked to this target will appear on the link
line for the other target too."

[1] https://cmake.org/cmake/help/v3.3/command/target_link_libraries.html#libraries-for-both-a-target-and-its-dependents

Signed-off-by: Nathan Cutler <ncutler@suse.com>
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 34d0a30)
  • Loading branch information
tchaikov authored and smithfarm committed Jun 3, 2017
1 parent 158b358 commit 2126af8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rgw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ add_library(radosgw_a STATIC ${radosgw_srcs}
$<TARGET_OBJECTS:civetweb_common_objs>)
target_link_libraries(radosgw_a rgw_a ${SSL_LIBRARIES})
if(WITH_RADOSGW_BEAST_FRONTEND)
target_link_libraries(radosgw_a LINK_PRIVATE
target_link_libraries(radosgw_a
${Boost_COROUTINE_LIBRARY}
${Boost_CONTEXT_LIBRARY})
endif()
Expand All @@ -181,7 +181,7 @@ target_link_libraries(radosgw radosgw_a librados
cls_log_client cls_statelog_client cls_timeindex_client
cls_version_client cls_replica_log_client cls_user_client
global ${FCGI_LIBRARY} ${LIB_RESOLV}
${CURL_LIBRARIES} ${Boost_LIBRARIES} ${EXPAT_LIBRARIES} ${BLKID_LIBRARIES}
${CURL_LIBRARIES} ${EXPAT_LIBRARIES} ${BLKID_LIBRARIES}
${ALLOC_LIBS})
# radosgw depends on cls libraries at runtime, but not as link dependencies
add_dependencies(radosgw cls_rgw cls_lock cls_refcount
Expand Down

0 comments on commit 2126af8

Please sign in to comment.