Skip to content

Commit 7724dbd

Browse files
authored
Merge pull request #105 from nigels-com/boost-1.90
For boost 1.90.0, perhaps
2 parents 241945f + 5ccd8dc commit 7724dbd

File tree

3 files changed

+81
-39
lines changed

3 files changed

+81
-39
lines changed

.github/workflows/ci.yml

Lines changed: 60 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ jobs:
7878
steps:
7979
- uses: actions/checkout@v4
8080

81-
- name: Install packages
82-
if: matrix.install
83-
run: sudo apt install ${{matrix.install}}
84-
8581
- name: Setup Boost
8682
run: |
8783
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
@@ -123,10 +119,6 @@ jobs:
123119
steps:
124120
- uses: actions/checkout@v4
125121

126-
- name: Install packages
127-
if: matrix.install
128-
run: sudo apt install ${{matrix.install}}
129-
130122
- name: Setup Boost
131123
run: |
132124
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
@@ -178,10 +170,6 @@ jobs:
178170
steps:
179171
- uses: actions/checkout@v4
180172

181-
- name: Install packages
182-
if: matrix.install
183-
run: sudo apt install ${{matrix.install}}
184-
185173
- name: Setup Boost
186174
run: |
187175
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
@@ -217,3 +205,63 @@ jobs:
217205
run: |
218206
cd ../boost-root/__build__
219207
ctest --output-on-failure --no-tests=error
208+
209+
posix-standalone-cmake-test:
210+
strategy:
211+
fail-fast: false
212+
matrix:
213+
include:
214+
- os: ubuntu-latest
215+
- os: macos-latest
216+
217+
runs-on: ${{matrix.os}}
218+
219+
steps:
220+
- uses: actions/checkout@v4
221+
222+
- name: Setup Boost
223+
run: |
224+
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
225+
LIBRARY=${GITHUB_REPOSITORY#*/}
226+
echo LIBRARY: $LIBRARY
227+
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
228+
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
229+
echo GITHUB_REF: $GITHUB_REF
230+
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
231+
REF=${REF#refs/heads/}
232+
echo REF: $REF
233+
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
234+
echo BOOST_BRANCH: $BOOST_BRANCH
235+
cd ..
236+
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
237+
cd boost-root
238+
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
239+
git submodule update --init tools/boostdep
240+
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
241+
242+
- name: Configure Boost
243+
run: |
244+
cd ../boost-root
245+
mkdir __build__ && cd __build__
246+
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
247+
248+
- name: Install Boost
249+
run: |
250+
cd ../boost-root/__build__
251+
cmake --build . --target install
252+
253+
- name: Configure
254+
run: |
255+
mkdir __build__
256+
cd __build__
257+
cmake -DBUILD_TESTING=ON -DCMAKE_INSTALL_PREFIX=~/.local ..
258+
259+
- name: Build tests
260+
run: |
261+
cd __build__
262+
cmake --build . --target tests
263+
264+
- name: Run tests
265+
run: |
266+
cd __build__
267+
ctest --output-on-failure --no-tests=error

CMakeLists.txt

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
11
# Generated by `boostdep --cmake sort`
2-
# Copyright 2020 Peter Dimov
2+
# Copyright 2020, 2021 Peter Dimov
33
# Copyright 2025 Nigel Stewart
44
# Distributed under the Boost Software License, Version 1.0.
55
# https://www.boost.org/LICENSE_1_0.txt
66

7-
message(STATUS "Using cmake version ${CMAKE_VERSION}")
7+
cmake_minimum_required(VERSION 3.10...3.31)
88

9-
cmake_minimum_required(VERSION 3.10...3.16)
10-
11-
if(BOOST_SUPERPROJECT_VERSION)
12-
project(boost_sort VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
13-
else()
14-
project(boost_sort LANGUAGES CXX)
15-
endif()
16-
17-
# Test coverage in stand-alone mode requires boost dependencies
18-
if(BUILD_TESTING AND NOT BOOST_SUPERPROJECT_VERSION)
19-
set(Boost_DEBUG ON)
20-
find_package(Boost 1.85 REQUIRED COMPONENTS core range included_test_exec_monitor)
21-
endif()
9+
project(boost_sort VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
2210

2311
add_library(boost_sort INTERFACE)
2412
add_library(Boost::sort ALIAS boost_sort)
@@ -34,17 +22,25 @@ target_link_libraries(boost_sort
3422
Boost::type_traits
3523
)
3624

25+
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
26+
27+
message(STATUS "Using CMake version ${CMAKE_VERSION}")
28+
29+
set(Boost_DEBUG ON)
30+
find_package(Boost 1.85 CONFIG REQUIRED COMPONENTS core range included_test_exec_monitor)
31+
32+
include(CTest)
33+
34+
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
35+
add_dependencies(check tests)
36+
37+
endif()
38+
3739
# Testing
3840
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
3941

40-
if(NOT BOOST_SUPERPROJECT_VERSION)
41-
include(CTest)
42-
enable_testing()
43-
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
44-
add_dependencies(check tests)
45-
endif()
46-
4742
# Follow the Boost convention: don't build test targets by default,
4843
# and only when explicitly requested by building target tests
4944
add_subdirectory(test EXCLUDE_FROM_ALL)
45+
5046
endif()

test/CMakeLists.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
set(CMAKE_CXX_STANDARD 11)
2-
set(CMAKE_CXX_STANDARD_REQUIRED ON)
3-
set(CMAKE_CXX_EXTENSIONS OFF)
4-
51
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
62
# warning level 4
73
add_compile_options(/W4)
@@ -21,11 +17,13 @@ endif()
2117

2218
set(PREFIX "boost_sort_")
2319
set(LINK_LIBRARIES Boost::sort Boost::included_test_exec_monitor)
20+
set(COMPILE_FEATURES cxx_std_11)
2421

2522
function(boost_sort_add_test name source)
2623
set(pname "${PREFIX}${name}")
2724
add_executable(${pname} ${source})
28-
target_link_libraries(${pname} ${LINK_LIBRARIES})
25+
target_link_libraries(${pname} PRIVATE ${LINK_LIBRARIES})
26+
target_compile_features(${pname} PRIVATE ${COMPILE_FEATURES})
2927
add_test(NAME ${pname} COMMAND ${pname})
3028
add_dependencies(tests ${pname})
3129
endfunction()

0 commit comments

Comments
 (0)