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:
266
266
with :
267
267
key : ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
268
268
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
+
269
279
# coreutils contains "nproc"
270
- - name : Install missing software on macos
280
+ - name : Install missing software on macOS
271
281
run : |
272
282
brew install coreutils boost
273
283
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)
275
299
run : |
276
300
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 : |
277
305
cmake --build cmake.output.boost -- -j$(nproc)
278
306
279
307
build :
Original file line number Diff line number Diff line change @@ -83,11 +83,12 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30")
83
83
cmake_policy (SET CMP0167 NEW)
84
84
endif ()
85
85
86
- # we are only using the header-only "container" component so we can unconditionally search for it
87
86
if (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 ()
91
92
endif ()
92
93
93
94
find_program (LIBXML2_XMLLINT_EXECUTABLE xmllint)
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ if(WARNINGS_ARE_ERRORS)
31
31
endif ()
32
32
option (EXTERNALS_AS_SYSTEM "Treat externals as system includes" OFF )
33
33
34
+ # we are only using the header-only "container" Boost component so we can unconditionally search for it by default
34
35
set (USE_MATCHCOMPILER "Auto" CACHE STRING "Usage of match compiler" )
35
36
set_property (CACHE USE_MATCHCOMPILER PROPERTY STRINGS Auto Off On Verify)
36
37
if (USE_MATCHCOMPILER)
@@ -88,7 +89,8 @@ option(DISALLOW_THREAD_EXECUTOR "Disallow usage of ThreadExecutor for -j"
88
89
if (DISALLOW_THREAD_EXECUTOR AND WIN32 )
89
90
message (FATAL_ERROR "Cannot disable usage of ThreadExecutor on Windows as no other executor implementation is currently available" )
90
91
endif ()
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 )
92
94
option (USE_BOOST_INT128 "Usage of Boost.Multiprecision 128-bit integer for Mathlib" OFF )
93
95
if (NOT USE_BOOST AND USE_BOOST_INT128)
94
96
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)
87
87
endif ()
88
88
message (STATUS )
89
89
message (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 ()
94
96
message (STATUS )
95
97
message (STATUS "USE_LIBCXX = ${USE_LIBCXX} " )
96
98
message (STATUS )
You can’t perform that action at this time.
0 commit comments