Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions .github/workflows/CI-unixish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,42 @@ jobs:
with:
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}

- name: Run CMake on macOS (force Boost)
run: |
# make sure we fail when Boost is requested and not available.
# will fail because no package configuration is available.
if cmake -S . -B cmake.output.boost-force-noavail -G "Unix Makefiles" -DUSE_BOOST=On; then
exit 1
else
exit 0
fi

# coreutils contains "nproc"
- name: Install missing software on macos
- name: Install missing software on macOS
run: |
brew install coreutils boost

- name: CMake build on macOS (with Boost)
- name: Run CMake on macOS (force Boost)
run: |
cmake -S . -B cmake.output.boost-force -G "Unix Makefiles" -DUSE_BOOST=On

- name: Run CMake on macOS (no Boost)
run: |
# make sure Boost is not used when disabled even though it is available
cmake -S . -B cmake.output.boost-no -G "Unix Makefiles" -DUSE_BOOST=Off
if grep -q '\-DHAVE_BOOST' ./cmake.output.boost-no/compile_commands.json; then
exit 1
else
exit 0
fi

- name: Run CMake on macOS (with Boost)
run: |
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
grep -q '\-DHAVE_BOOST' ./cmake.output.boost/compile_commands.json

- name: Build with CMake on macOS (with Boost)
run: |
cmake --build cmake.output.boost -- -j$(nproc)

build:
Expand Down
9 changes: 5 additions & 4 deletions cmake/findDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30")
cmake_policy(SET CMP0167 NEW)
endif()

# we are only using the header-only "container" component so we can unconditionally search for it
if(USE_BOOST)
find_package(Boost REQUIRED)
else()
find_package(Boost)
if(USE_BOOST STREQUAL "Auto")
find_package(Boost)
else()
find_package(Boost REQUIRED)
endif()
endif()

find_program(LIBXML2_XMLLINT_EXECUTABLE xmllint)
4 changes: 3 additions & 1 deletion cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if(WARNINGS_ARE_ERRORS)
endif()
option(EXTERNALS_AS_SYSTEM "Treat externals as system includes" OFF)

# we are only using the header-only "container" Boost component so we can unconditionally search for it by default
set(USE_MATCHCOMPILER "Auto" CACHE STRING "Usage of match compiler")
set_property(CACHE USE_MATCHCOMPILER PROPERTY STRINGS Auto Off On Verify)
if(USE_MATCHCOMPILER)
Expand Down Expand Up @@ -88,7 +89,8 @@ option(DISALLOW_THREAD_EXECUTOR "Disallow usage of ThreadExecutor for -j"
if(DISALLOW_THREAD_EXECUTOR AND WIN32)
message(FATAL_ERROR "Cannot disable usage of ThreadExecutor on Windows as no other executor implementation is currently available")
endif()
option(USE_BOOST "Force usage of Boost" OFF)
set(USE_BOOST "Auto" CACHE STRING "Usage of Boost")
set_property(CACHE USE_BOOST PROPERTY STRINGS Auto Off On)
option(USE_BOOST_INT128 "Usage of Boost.Multiprecision 128-bit integer for Mathlib" OFF)
if (NOT USE_BOOST AND USE_BOOST_INT128)
message(FATAL_ERROR "USE_BOOST_INT128 requires USE_BOOST to be enabled")
Expand Down
10 changes: 6 additions & 4 deletions cmake/printInfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ if(NOT USE_BUNDLED_TINYXML2)
endif()
message(STATUS)
message(STATUS "USE_BOOST = ${USE_BOOST}")
message(STATUS "Boost_FOUND = ${Boost_FOUND}")
message(STATUS "Boost_VERSION_STRING = ${Boost_VERSION_STRING}")
message(STATUS "Boost_INCLUDE_DIRS = ${Boost_INCLUDE_DIRS}")
message(STATUS "USE_BOOST_INT128 = ${USE_BOOST_INT128}")
if(USE_BOOST)
message(STATUS "Boost_FOUND = ${Boost_FOUND}")
message(STATUS "Boost_VERSION_STRING = ${Boost_VERSION_STRING}")
message(STATUS "Boost_INCLUDE_DIRS = ${Boost_INCLUDE_DIRS}")
message(STATUS "USE_BOOST_INT128 = ${USE_BOOST_INT128}")
endif()
message(STATUS)
message(STATUS "USE_LIBCXX = ${USE_LIBCXX}")
message(STATUS)
Expand Down