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: testing/wip-batrick-testing-20240411.154038~460^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c7155c3db7365e8b25d15af6c2fd2b2871aa552f;p=ceph-ci.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 a2257879590..47cd702ca22 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()