Skip to content

Commit f68ba93

Browse files
authored
fixed #14002 - added missing Boost include for testrunner (danmar#7660)
fixes build with Boost installed in non-default system include dir
1 parent 0b4c55a commit f68ba93

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

.github/workflows/CI-unixish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,39 @@ jobs:
243243
run: |
244244
ls lib/*.cpp | xargs -n 1 -P $(nproc) g++ -fsyntax-only -std=c++0x -Ilib -Iexternals -Iexternals/picojson -Iexternals/simplecpp -Iexternals/tinyxml2 -DNONNEG
245245
246+
build_cmake_boost:
247+
248+
strategy:
249+
matrix:
250+
os: [macos-13, macos-15] # non-macos platforms are already built with Boost in other contexts
251+
fail-fast: false # Prefer quick result
252+
253+
runs-on: ${{ matrix.os }}
254+
255+
env:
256+
# TODO: figure out why there are cache misses with PCH enabled
257+
CCACHE_SLOPPINESS: pch_defines,time_macros
258+
259+
steps:
260+
- uses: actions/checkout@v4
261+
with:
262+
persist-credentials: false
263+
264+
- name: ccache
265+
uses: hendrikmuhs/ccache-action@v1.2
266+
with:
267+
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
268+
269+
# coreutils contains "nproc"
270+
- name: Install missing software on macos
271+
run: |
272+
brew install coreutils boost
273+
274+
- name: CMake build on macOS (with Boost)
275+
run: |
276+
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
277+
cmake --build cmake.output.boost -- -j$(nproc)
278+
246279
build:
247280

248281
strategy:

test/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ if (BUILD_TESTS)
2020
target_include_directories(testrunner SYSTEM PRIVATE ${tinyxml2_INCLUDE_DIRS})
2121
endif()
2222
target_externals_include_directories(testrunner PRIVATE ${PROJECT_SOURCE_DIR}/externals/simplecpp/)
23+
if (Boost_FOUND)
24+
target_include_directories(testrunner SYSTEM PRIVATE ${Boost_INCLUDE_DIRS})
25+
endif()
2326
if (HAVE_RULES)
2427
target_link_libraries(testrunner ${PCRE_LIBRARY})
2528
endif()

0 commit comments

Comments
 (0)