File tree Expand file tree Collapse file tree 4 files changed +44
-11
lines changed Expand file tree Collapse file tree 4 files changed +44
-11
lines changed Original file line number Diff line number Diff line change @@ -266,14 +266,42 @@ jobs:
266266 with :
267267 key : ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
268268
269+ - name : Run CMake on macOS (force Boost)
270+ run : |
271+ # make sure we fail when Boost is requested and not available.
272+ # will fail because no package configuration is available.
273+ if cmake -S . -B cmake.output.boost-force-noavail -G "Unix Makefiles" -DUSE_BOOST=On; then
274+ exit 1
275+ else
276+ exit 0
277+ fi
278+
269279 # coreutils contains "nproc"
270- - name : Install missing software on macos
280+ - name : Install missing software on macOS
271281 run : |
272282 brew install coreutils boost
273283
274- - name : CMake build on macOS (with Boost)
284+ - name : Run CMake on macOS (force Boost)
285+ run : |
286+ cmake -S . -B cmake.output.boost-force -G "Unix Makefiles" -DUSE_BOOST=On
287+
288+ - name : Run CMake on macOS (no Boost)
289+ run : |
290+ # make sure Boost is not used when disabled even though it is available
291+ cmake -S . -B cmake.output.boost-no -G "Unix Makefiles" -DUSE_BOOST=Off
292+ if grep -q '\-DHAVE_BOOST' ./cmake.output.boost-no/compile_commands.json; then
293+ exit 1
294+ else
295+ exit 0
296+ fi
297+
298+ - name : Run CMake on macOS (with Boost)
275299 run : |
276300 cmake -S . -B cmake.output.boost -G "Unix Makefiles" -DBUILD_TESTS=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
301+ grep -q '\-DHAVE_BOOST' ./cmake.output.boost/compile_commands.json
302+
303+ - name : Build with CMake on macOS (with Boost)
304+ run : |
277305 cmake --build cmake.output.boost -- -j$(nproc)
278306
279307 build :
Original file line number Diff line number Diff line change @@ -83,11 +83,12 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30")
8383 cmake_policy (SET CMP0167 NEW)
8484endif ()
8585
86- # we are only using the header-only "container" component so we can unconditionally search for it
8786if (USE_BOOST)
88- find_package (Boost REQUIRED)
89- else ()
90- find_package (Boost)
87+ if (USE_BOOST STREQUAL "Auto" )
88+ find_package (Boost)
89+ else ()
90+ find_package (Boost REQUIRED)
91+ endif ()
9192endif ()
9293
9394find_program (LIBXML2_XMLLINT_EXECUTABLE xmllint)
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ if(WARNINGS_ARE_ERRORS)
3131endif ()
3232option (EXTERNALS_AS_SYSTEM "Treat externals as system includes" OFF )
3333
34+ # we are only using the header-only "container" Boost component so we can unconditionally search for it by default
3435set (USE_MATCHCOMPILER "Auto" CACHE STRING "Usage of match compiler" )
3536set_property (CACHE USE_MATCHCOMPILER PROPERTY STRINGS Auto Off On Verify)
3637if (USE_MATCHCOMPILER)
@@ -88,7 +89,8 @@ option(DISALLOW_THREAD_EXECUTOR "Disallow usage of ThreadExecutor for -j"
8889if (DISALLOW_THREAD_EXECUTOR AND WIN32 )
8990 message (FATAL_ERROR "Cannot disable usage of ThreadExecutor on Windows as no other executor implementation is currently available" )
9091endif ()
91- option (USE_BOOST "Force usage of Boost" OFF )
92+ set (USE_BOOST "Auto" CACHE STRING "Usage of Boost" )
93+ set_property (CACHE USE_BOOST PROPERTY STRINGS Auto Off On )
9294option (USE_BOOST_INT128 "Usage of Boost.Multiprecision 128-bit integer for Mathlib" OFF )
9395if (NOT USE_BOOST AND USE_BOOST_INT128)
9496 message (FATAL_ERROR "USE_BOOST_INT128 requires USE_BOOST to be enabled" )
Original file line number Diff line number Diff line change @@ -87,10 +87,12 @@ if(NOT USE_BUNDLED_TINYXML2)
8787endif ()
8888message (STATUS )
8989message (STATUS "USE_BOOST = ${USE_BOOST} " )
90- message (STATUS "Boost_FOUND = ${Boost_FOUND} " )
91- message (STATUS "Boost_VERSION_STRING = ${Boost_VERSION_STRING} " )
92- message (STATUS "Boost_INCLUDE_DIRS = ${Boost_INCLUDE_DIRS} " )
93- message (STATUS "USE_BOOST_INT128 = ${USE_BOOST_INT128} " )
90+ if (USE_BOOST)
91+ message (STATUS "Boost_FOUND = ${Boost_FOUND} " )
92+ message (STATUS "Boost_VERSION_STRING = ${Boost_VERSION_STRING} " )
93+ message (STATUS "Boost_INCLUDE_DIRS = ${Boost_INCLUDE_DIRS} " )
94+ message (STATUS "USE_BOOST_INT128 = ${USE_BOOST_INT128} " )
95+ endif ()
9496message (STATUS )
9597message (STATUS "USE_LIBCXX = ${USE_LIBCXX} " )
9698message (STATUS )
You can’t perform that action at this time.
0 commit comments