Skip to content

Commit 340e5d9

Browse files
committed
Update libraries and tests for Boost v1.86.0
* Add example for Boost::predef * It seems something changed about Boost::predef in 1.86.0. It is listed as a lib but not build as a lib. * Add Boost::predef to test matrix * Add Boost::process to test matrix * Add example for v2 of Boost::process * Boost::process changed in the 1.86.0 release. * v1 is header only * v2 is a library
1 parent 1c0d77f commit 340e5d9

File tree

9 files changed

+162
-0
lines changed

9 files changed

+162
-0
lines changed

cmake/modules/hunter_get_boost_libs.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ function(hunter_get_boost_libs)
7474
hunter_append_component(${common_args} COMPONENT metaparse SINCE 1.61.0 UNTIL 1.66.0)
7575
hunter_append_component(${common_args} COMPONENT mpi SINCE 1.35.0)
7676
hunter_append_component(${common_args} COMPONENT nowide SINCE 1.74.0)
77+
hunter_append_component(${common_args} COMPONENT predef SINCE 1.86.0) # is listed as a lib since 1.86.0, but can not be built as one
78+
hunter_append_component(${common_args} COMPONENT process SINCE 1.86.0) # was header only until 1.86.0
7779
hunter_append_component(${common_args} COMPONENT program_options SINCE 1.32.0)
7880
hunter_append_component(${common_args} COMPONENT python SINCE 1.19.0)
7981
hunter_append_component(${common_args} COMPONENT random SINCE 1.15.0)

cmake/projects/Boost/ci/matrix.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,32 @@
167167
{ "example": "Boost-math", "toolchain": "mingw-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" },
168168
{ "example": "Boost-math", "toolchain": "msys-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" },
169169

170+
{ "example": "Boost-predef", "toolchain": "clang-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },
171+
// { "example": "Boost-predef", "toolchain": "gcc-7-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },
172+
// { "example": "Boost-predef", "toolchain": "gcc-8-cxx17-fpic", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },
173+
// { "example": "Boost-predef", "toolchain": "gcc-9-cxx17-fpic", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },
174+
{ "example": "Boost-predef", "toolchain": "android-ndk-r17-api-24-arm64-v8a-clang-libcxx14", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },
175+
// { "example": "Boost-predef", "toolchain": "osx-12-3-arch-universal2-cxx17", "os": "macos-12", "python": "3.8", "script": "build.sh" },
176+
{ "example": "Boost-predef", "toolchain": "ios-nocodesign-15-5-arm64-cxx17", "os": "macos-12", "python": "3.8", "script": "build.sh" },
177+
// { "example": "Boost-predef", "toolchain": "ninja-vs-16-2019-win64-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" },
178+
// { "example": "Boost-predef", "toolchain": "nmake-vs-16-2019-win64-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" },
179+
// { "example": "Boost-predef", "toolchain": "vs-16-2019-win64-sdk-10-0-18362-0-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" },
180+
{ "example": "Boost-predef", "toolchain": "mingw-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" },
181+
{ "example": "Boost-predef", "toolchain": "msys-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" },
182+
183+
//{ "example": "Boost-process", "toolchain": "clang-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },
184+
// { "example": "Boost-process", "toolchain": "gcc-7-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },
185+
// { "example": "Boost-process", "toolchain": "gcc-8-cxx17-fpic", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },
186+
// { "example": "Boost-process", "toolchain": "gcc-9-cxx17-fpic", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },
187+
//{ "example": "Boost-process", "toolchain": "android-ndk-r17-api-24-arm64-v8a-clang-libcxx14", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },
188+
// { "example": "Boost-process", "toolchain": "osx-12-3-arch-universal2-cxx17", "os": "macos-12", "python": "3.8", "script": "build.sh" },
189+
//{ "example": "Boost-process", "toolchain": "ios-nocodesign-15-5-arm64-cxx17", "os": "macos-12", "python": "3.8", "script": "build.sh" },
190+
//{ "example": "Boost-process", "toolchain": "ninja-vs-16-2019-win64-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" },
191+
// { "example": "Boost-process", "toolchain": "nmake-vs-16-2019-win64-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" },
192+
// { "example": "Boost-process", "toolchain": "vs-16-2019-win64-sdk-10-0-18362-0-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" },
193+
//{ "example": "Boost-process", "toolchain": "mingw-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" },
194+
//{ "example": "Boost-process", "toolchain": "msys-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" },
195+
170196
{ "example": "BoostProcess", "toolchain": "clang-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },
171197
// { "example": "BoostProcess", "toolchain": "gcc-7-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },
172198
// { "example": "BoostProcess", "toolchain": "gcc-8-cxx17-fpic", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },

cmake/projects/Boost/generate.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ BOOST_LIBS="
2626
math
2727
mpi
2828
nowide
29+
predef
30+
process
2931
program_options
3032
python
3133
random
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2013, Ruslan Baratov
2+
# All rights reserved.
3+
4+
# !!! DO NOT PLACE HEADER GUARDS HERE !!!
5+
6+
include(hunter_download)
7+
include(hunter_pick_scheme)
8+
9+
hunter_pick_scheme(
10+
DEFAULT
11+
url_sha1_boost_library
12+
IPHONEOS
13+
url_sha1_boost_ios_library
14+
)
15+
16+
hunter_download(
17+
PACKAGE_NAME
18+
Boost
19+
PACKAGE_COMPONENT
20+
predef
21+
PACKAGE_INTERNAL_DEPS_ID "50"
22+
)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2013, Ruslan Baratov
2+
# All rights reserved.
3+
4+
# !!! DO NOT PLACE HEADER GUARDS HERE !!!
5+
6+
include(hunter_download)
7+
include(hunter_pick_scheme)
8+
9+
hunter_pick_scheme(
10+
DEFAULT
11+
url_sha1_boost_library
12+
IPHONEOS
13+
url_sha1_boost_ios_library
14+
)
15+
16+
hunter_download(
17+
PACKAGE_NAME
18+
Boost
19+
PACKAGE_COMPONENT
20+
process
21+
PACKAGE_INTERNAL_DEPS_ID "50"
22+
)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright (c) 2025, Dominik Nussbaumer
2+
# All rights reserved.
3+
4+
cmake_minimum_required(VERSION 3.10)
5+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
6+
set(Boost_DEBUG ON CACHE BOOLEAN "")
7+
set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/../Boost-useBoostConfig/config.cmake)
8+
9+
# Emulate HunterGate:
10+
# * https://github.com/cpp-pm/gate
11+
include("../common.cmake")
12+
13+
project(download-boost)
14+
15+
hunter_add_package(Boost)
16+
find_package(Boost CONFIG)
17+
18+
add_executable(foo foo.cpp)
19+
target_link_libraries(foo PUBLIC Boost::boost)

examples/Boost-predef/foo.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// https://www.boost.org/doc/libs/1_83_0/libs/predef/doc/index.html#_using_the_predefs
2+
#include <boost/predef.h>
3+
#include <iostream>
4+
5+
int main()
6+
{
7+
if (BOOST_COMP_GNUC >= BOOST_VERSION_NUMBER(4,0,0))
8+
std::cout << "GCC compiler is at least version 4.0.0" << std::endl;
9+
else
10+
std::cout << "GCC compiler is at older than version 4.0.0, or not a GCC compiler" << std::endl;
11+
return 0;
12+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2025, Dominik Nussbaumer
2+
# All rights reserved.
3+
4+
cmake_minimum_required(VERSION 3.10)
5+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
6+
set(Boost_DEBUG ON CACHE BOOLEAN "")
7+
set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/../Boost-useBoostConfig/config.cmake)
8+
9+
# Emulate HunterGate:
10+
# * https://github.com/cpp-pm/gate
11+
include("../common.cmake")
12+
13+
project(download-boost)
14+
hunter_add_package(Boost COMPONENTS process)
15+
find_package(Boost CONFIG REQUIRED process)
16+
17+
add_executable(foo foo.cpp)
18+
target_link_libraries(foo PUBLIC Boost::process)

examples/Boost-process/foo.cpp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright (c) 2022 Klemens Morgenstern
2+
//
3+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
4+
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5+
6+
//[intro
7+
#include <boost/process/v2.hpp>
8+
9+
#include <boost/asio/read.hpp>
10+
#include <boost/asio/readable_pipe.hpp>
11+
#include <boost/system/error_code.hpp>
12+
13+
#include <string>
14+
#include <iostream>
15+
16+
namespace proc = boost::process::v2;
17+
namespace asio = boost::asio;
18+
19+
20+
int main()
21+
{
22+
asio::io_context ctx;
23+
asio::readable_pipe p{ctx};
24+
25+
const auto exe = proc::environment::find_executable("gcc");
26+
27+
proc::process c{ctx, exe, {"--version"}, proc::process_stdio{nullptr, p}};
28+
29+
std::string line;
30+
boost::system::error_code ec;
31+
32+
auto sz = asio::read(p, asio::dynamic_buffer(line), ec);
33+
assert(ec == asio::error::eof);
34+
35+
std::cout << "Gcc version: '" << line << "'" << std::endl;
36+
37+
c.wait();
38+
}
39+
//]

0 commit comments

Comments
 (0)