From: Kefu Chai Date: Sun, 11 Feb 2024 07:42:14 +0000 (+0800) Subject: cmake: build boost debug variant when CMAKE_BUILD_TYPE is Debug X-Git-Tag: v19.3.0~42^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F55528%2Fhead;p=ceph.git 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 --- diff --git a/cmake/modules/BuildBoost.cmake b/cmake/modules/BuildBoost.cmake index a22578795908..47cd702ca225 100644 --- a/cmake/modules/BuildBoost.cmake +++ b/cmake/modules/BuildBoost.cmake @@ -47,7 +47,11 @@ endmacro() 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()