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>
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