]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: configure boost build with concurrent jobs 45750/head
authorMoritz Röhrich <moritz.rohrich@suse.com>
Fri, 1 Apr 2022 16:34:25 +0000 (18:34 +0200)
committerMoritz Röhrich <moritz.rohrich@suse.com>
Tue, 31 May 2022 08:09:24 +0000 (10:09 +0200)
When building boost, try to schedule multiple build jobs in parallel. If
provided with `-DBOOST_J=<n>`, the given number of jobst is going to be
used.

Signed-off-by: Moritz Röhrich <moritz.rohrich@suse.com>
CMakeLists.txt

index f4d6e14fbbcf4e7f43db118cff8252491eae6d30..a1cd6aaa770957fdefce7a41ad704912609f1a69 100644 (file)
@@ -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=<n>
+  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=<n>
   set(Boost_USE_STATIC_LIBS ON)
   include(BuildBoost)
   build_boost(1.75