boost has some different predefined build variants. they are quite
like CMake's CMAKE_BUILD_TYPE. in which, "debug" enables some
features related features. so it would be nice if we can have it
enabled for the Debug build, if the boost is built from source.
see also
https://www.boost.org/build/doc/html/bbv2/overview/builtins/features.html
before this change, we always build the "release" variant. in this
change, "debug" variant is built if Ceph's is built with
CMAKE_BUILD_TYPE=Debug. please note, this change does not change
the way how boost is built when packaging Ceph, as our debian/rpm
receipts do not define CMAKE_BUILD_TYPE and respect the distros'
settings, in that case, the "release" variant is still built.
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
function(do_build_boost root_dir version)
cmake_parse_arguments(Boost_BUILD "" "" COMPONENTS ${ARGN})
- set(boost_features "variant=release")
+ if(CMAKE_BUILD_TYPE STREQUAL Debug)
+ set(boost_features "variant=debug")
+ else()
+ set(boost_features "variant=release")
+ endif()
if(Boost_USE_MULTITHREADED)
list(APPEND boost_features "threading=multi")
else()