Skip to content

Commit

Permalink
cmake: introduce Boost::MPL interface library
Browse files Browse the repository at this point in the history
Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed Sep 18, 2020
1 parent 822b91e commit 0cf2e89
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,16 @@ else()
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/src/fmt/include")
endif()

# in osd/PeeringState.h, the number of elements in PeeringState::Active::reactions
# is now 21 which exceeds the default value of BOOST_MPL_LIMIT_VECTOR_SIZE, which
# is 20. so we need to override it. see
# https://www.boost.org/doc/libs/1_74_0/libs/mpl/doc/refmanual/limit-list-size.html
# link with this library, if your code includes osd/PeeringState.h (indirectly)
add_library(Boost::MPL INTERFACE IMPORTED)
set_target_properties(Boost::MPL PROPERTIES
INTERFACE_COMPILE_DEFINITIONS
"BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_LIST_SIZE=30")

if(WITH_SEASTAR)
find_package(c-ares 1.13.0 QUIET)
if(NOT c-ares_FOUND)
Expand Down
3 changes: 2 additions & 1 deletion src/crimson/admin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ add_library(crimson-admin STATIC
pg_commands.cc)

target_link_libraries(crimson-admin
crimson::cflags)
crimson::cflags
Boost::MPL)
1 change: 1 addition & 0 deletions src/crimson/osd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ target_link_libraries(crimson-osd
crimson-os
crimson
fmt::fmt
Boost::MPL
dmclock::dmclock)
set_target_properties(crimson-osd PROPERTIES
POSITION_INDEPENDENT_CODE ${EXE_LINKER_USE_PIE})
Expand Down
2 changes: 1 addition & 1 deletion src/osd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if(HAS_VTA)
endif()
add_library(osd STATIC ${osd_srcs})
target_link_libraries(osd
PUBLIC dmclock::dmclock
PUBLIC dmclock::dmclock Boost::MPL
PRIVATE os heap_profiler cpu_profiler ${CMAKE_DL_LIBS})
if(WITH_LTTNG)
add_dependencies(osd osd-tp pg-tp)
Expand Down

0 comments on commit 0cf2e89

Please sign in to comment.