Skip to content

Commit c7155c3

Browse files
committed
cmake: build boost debug variant when CMAKE_BUILD_TYPE is Debug
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 <[email protected]>
1 parent 8bbeeb8 commit c7155c3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmake/modules/BuildBoost.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ endmacro()
4747

4848
function(do_build_boost root_dir version)
4949
cmake_parse_arguments(Boost_BUILD "" "" COMPONENTS ${ARGN})
50-
set(boost_features "variant=release")
50+
if(CMAKE_BUILD_TYPE STREQUAL Debug)
51+
set(boost_features "variant=debug")
52+
else()
53+
set(boost_features "variant=release")
54+
endif()
5155
if(Boost_USE_MULTITHREADED)
5256
list(APPEND boost_features "threading=multi")
5357
else()

0 commit comments

Comments
 (0)