From: Moritz Röhrich Date: Fri, 1 Apr 2022 16:34:25 +0000 (+0200) Subject: cmake: configure boost build with concurrent jobs X-Git-Tag: v18.0.0~684^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e8ddf7cfdc40ac81c883b93d94bc2749436e99a3;p=ceph.git cmake: configure boost build with concurrent jobs When building boost, try to schedule multiple build jobs in parallel. If provided with `-DBOOST_J=`, the given number of jobst is going to be used. Signed-off-by: Moritz Röhrich --- diff --git a/CMakeLists.txt b/CMakeLists.txt index f4d6e14fbbcf..a1cd6aaa7709 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -635,8 +635,12 @@ if(WITH_SYSTEM_BOOST) INTERFACE_LINK_LIBRARIES ZLIB::ZLIB) endif() else() - set(BOOST_J 1 CACHE STRING - "max jobs for Boost build") # override w/-DBOOST_J= + include(ProcessorCount) + ProcessorCount(DEFAULT_BOOST_J) + if(DEFAULT_BOOST_J EQUAL 0) + set(DEFAULT_BOOST_J 1) + endif() + set(BOOST_J ${DEFAULT_BOOST_J} CACHE STRING "max jobs for Boost build") # override w/-DBOOST_J= set(Boost_USE_STATIC_LIBS ON) include(BuildBoost) build_boost(1.75