Skip to content
Open
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
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ message = Bump version: {current_version} -> {new_version}
tag_message = Release v{new_version}
tag_name = v{new_version}
tag = True
current_version = 1.90.0-rc2
current_version = 1.91.0-rc1
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)([-](?P<release>(dev|rc))+(?P<build>\d+))?
serialize =
{major}.{minor}.{patch}-{release}{build}
Expand Down
2 changes: 1 addition & 1 deletion .bumpversion.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Start with an initial release, say `1.0.0`.
`ValueError: The part has already the maximum value among ['dev', 'rc', 'ga'] and cannot be bumped`.
* A whole version string may be set with:

bumpversion --new-version 1.90.0 patch --no-commit --no-tag --allow-dirty
bumpversion --new-version 1.91.0-rc0 release --no-commit --no-tag --allow-dirty

# Reference

Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,31 @@ jobs:
fail-fast: false

matrix:
os: [macos, ubuntu, windows]
os: [macos-latest, ubuntu-26.04, windows-latest]

runs-on: ${{ matrix.os }}-latest
runs-on: ${{ matrix.os }} # -latest

steps:
- uses: actions/checkout@v4
- name: Setup build environment
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~4.3.4"
ninjaVersion: "^1.13.0"

cmakeVersion: "^4.3.4"
ninjaVersion: "~1.13.0"
- name: Setup MSVC
if: startsWith(matrix.os, 'windows')
uses: TheMrMilchmann/setup-msvc-dev@v3
uses: TheMrMilchmann/setup-msvc-dev@v4
with:
arch: x64

- name: Setup Cpp
if: matrix.os != 'windows'
if: matrix.os != 'windows-latest'
uses: aminya/setup-cpp@v1
with:
compiler: llvm
compiler: llvm-22

- name: Configure CMake
run: cmake --preset ${{env.BUILD_TYPE}} --log-level=VERBOSE
run: cmake --preset ${{env.BUILD_TYPE}} --log-level=VERBOSE -D BOOST_USE_MODULES=ON

- name: Build
# Build your program with the given configuration
Expand Down
17 changes: 9 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
# - id: trailing-whitespace
- id: trailing-whitespace
exclude: ^.*\.(patch|cfg)$
- id: end-of-file-fixer
- id: check-json
- id: check-yaml
Expand All @@ -15,18 +16,18 @@ repos:
# This brings in a portable version of clang-format.
# See also: https://github.com/ssciwr/clang-format-wheel
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v22.1.0
rev: v22.1.5
hooks:
- id: clang-format
types_or: [c++, c, json]
exclude: docs/TODO.json

# CMake linting and formatting
- repo: https://github.com/BlankSpruce/gersemi
rev: 0.26.0
hooks:
- id: gersemi
name: CMake linting
# # CMake linting and formatting
# - repo: https://github.com/BlankSpruce/gersemi
# rev: 0.27.7
# hooks:
# - id: gersemi
# name: CMake linting

# TODO: Markdown linting
# Config file: .markdownlint.yaml
Expand Down
42 changes: 28 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
cmake_minimum_required(VERSION 3.30...4.3)
cmake_minimum_required(VERSION 3.30...4.4)

include(cmake/enable-experimental-import-std.cmake)

# gersemi: off
project(Boost-CMake LANGUAGES CXX VERSION 1.90.0.2)
project(Boost-CMake LANGUAGES CXX VERSION 1.91.0.1)
# gersemi: on

if(PROJECT_IS_TOP_LEVEL)
Expand All @@ -12,7 +14,11 @@ if(PROJECT_IS_TOP_LEVEL)
option(BOOST_USE_MODULES "Do build with CXX_MODULES if possible" OFF)
if(BOOST_USE_MODULES)
set(CMAKE_CXX_SCAN_FOR_MODULES ON)
set(CMAKE_CXX_MODULE_STD OFF) # TODO(CK): not yet!
if(CMAKE_CXX_STANDARD GREATER_EQUAL 23)
set(CMAKE_CXX_MODULE_STD ON)
else()
set(CMAKE_CXX_MODULE_STD OFF)
endif()
else()
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
endif()
Expand Down Expand Up @@ -73,18 +79,24 @@ endif()

set(BOOST_LIBS_REQUIRED headers)
set(BOOST_EXCLUDE_LIBRARIES
any
cobalt
contract # FIXME: deps on any! CK
fiber
iostreams
graph # FIXME: deps on any! CK
locale
log
json
program_options # FIXME: deps on any! CK
property_map # FIXME: deps on any! CK
property_tree # FIXME: deps on any! CK
timer
wave
)

if(PROJECT_IS_TOP_LEVEL AND NOT BOOST_BUILD_ALL)
# NOTE: Compiled libs without warnings OSX with clang v21.1.7! CK
# NOTE: Compiled libs without warnings OSX with clang v22.1.7! CK
list(
APPEND BOOST_INCLUDE_LIBRARIES
${BOOST_LIBS_REQUIRED}
Expand All @@ -94,21 +106,22 @@ if(PROJECT_IS_TOP_LEVEL AND NOT BOOST_BUILD_ALL)
beast # deps on type_index
chrono
container
contract # deps on any
contract # TODO: deps on any! CK
coroutine
exception
filesystem # FIXME: Warnings with g++-15 on OSX! CK
geometry # deps on any
graph # deps on any, serialization
graph # TODO: deps on any, serialization! CK
json
lexical_cast # use BOOST_USE_MODULES
math
optional
parser # deps on type_index
pfr # use BOOST_USE_MODULES
process # deps on type_index
program_options # deps on any
property_map # deps on any
property_tree # deps on any
program_options # TODO: deps on any! CK
property_map # TODO: deps on any! CK
property_tree # TODO: deps on any! CK
regex
serialization
signals2
Expand All @@ -131,7 +144,7 @@ endif()
# ---- Add/prepare dependency handling via CPM ----
# see https://github.com/TheLartians/CPM.cmake for more info

set(BOOST_SUBDIR boost_1_90_0)
set(BOOST_SUBDIR boost-1.91.0-1)
if(EXISTS "$ENV{CPM_SOURCE_CACHE}/${BOOST_SUBDIR}")
set(FETCHCONTENT_SOURCE_DIR_BOOST
"$ENV{CPM_SOURCE_CACHE}/${BOOST_SUBDIR}"
Expand All @@ -147,14 +160,15 @@ if(FETCHCONTENT_SOURCE_DIR_BOOST)
)
endif()

set(BOOST_VERSION 1.90.0)
set(BOOST_VERSION 1.91.0)
set(BOOST_FILE_VERSION ${BOOST_VERSION}-1)
set(BOOST_URL
"https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION}-cmake.7z"
"https://github.com/boostorg/boost/releases/download/boost-${BOOST_FILE_VERSION}/boost-${BOOST_FILE_VERSION}-cmake.7z"
CACHE STRING
"Boost download URL"
)
set(BOOST_URL_SHA256
"218e74c4aa362a994b7b7a23b2920f455a00205c656405fcf262cf60b8871921"
"29c7d4f4ac36ad853b6765d03571ea60d90286775df026b4efd9f3281131972b"
CACHE STRING
"Boost download URL SHA256 checksum"
)
Expand All @@ -178,7 +192,7 @@ if(NOT Boost_POPULATED)
message(STATUS "Fetching Boost")
FetchContent_MakeAvailable(Boost)
message(STATUS "Fetching Boost - done")
set(BOOST_SOURCE ${boost_SOURCE_DIR})
set(BOOST_SOURCE ${Boost_SOURCE_DIR})
message(STATUS "Boost_SOURCE_DIR=${Boost_SOURCE_DIR}")
endif()

Expand Down
2 changes: 1 addition & 1 deletion CMakeReleasePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"BOOST_STANDALONE": true,
"BUILD_SHARED_LIBS": true,
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_EXTENSIONS": true,
"CMAKE_CXX_EXTENSIONS": false,
"CMAKE_CXX_STANDARD": "20",
"CMAKE_CXX_STANDARD_REQUIRED": true,
"CMAKE_DEBUG_POSTFIX": "-d",
Expand Down
26 changes: 14 additions & 12 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ ifeq (${hostSystemName},Darwin)
export LLVM_DIR:=$(shell realpath ${LLVM_PREFIX})
export PATH:=${LLVM_DIR}/bin:${PATH}

export CMAKE_CXX_STDLIB_MODULES_JSON:=${LLVM_DIR}/lib/c++/libc++.modules.json
export CXX:=clang++
export LDFLAGS:=-L$(LLVM_DIR)/lib/c++ -lc++abi # NO! -lc++ -lc++experimental
export GCOV:="llvm-cov gcov"
# export CMAKE_CXX_STDLIB_MODULES_JSON:=${LLVM_DIR}/lib/c++/libc++.modules.json
# export CXX:=clang++
# export LDFLAGS:=-L$(LLVM_DIR)/lib/c++ -lc++abi # NO! -lc++ -lc++experimental
# export GCOV:="llvm-cov gcov"

### TODO: to test g++-15:
### TODO: to test g++-16:
export GCC_PREFIX:=$(shell brew --prefix gcc)
export GCC_DIR:=$(shell realpath ${GCC_PREFIX})

# export CMAKE_CXX_STDLIB_MODULES_JSON:=${GCC_DIR}/lib/gcc/current/libstdc++.modules.json
# export CXX::=g++-15
# export CXXFLAGS:=-stdlib=libstdc++
# export GCOV:="gcov"
export CMAKE_CXX_STDLIB_MODULES_JSON:=${GCC_DIR}/lib/gcc/current/libstdc++.modules.json
export CXX:=g++-16
export CXXFLAGS:=-stdlib=libstdc++
export GCOV:="gcov"
else ifeq (${hostSystemName},Linux)
export LLVM_DIR:=/usr/lib/llvm-20
export PATH:=${LLVM_DIR}/bin:${PATH}
Expand All @@ -42,13 +42,15 @@ examples: # XXX install
ninja -C build test -v

fresh:
cmake --workflow --preset Release --log-level=VERBOSE --fresh
cmake --workflow --preset Release --fresh

compile_commands.json: build/Release/compile_commands.json
ln -sf $< .

# NOTE: Works only yet on OSX with clang v22.1.7 with this arguments! CK
build/Release/compile_commands.json: GNUmakefile CMakeLists.txt
cmake --preset Release --log-level=VERBOSE
cmake --preset Release --log-level=VERBOSE -D BOOST_USE_MODULES=ON -D CMAKE_CXX_MODULE_STD=ON \
-D CMAKE_CXX_STDLIB_MODULES_JSON=${CMAKE_CXX_STDLIB_MODULES_JSON} -D CMAKE_CXX_STANDARD=26

build: compile_commands.json
cmake --build --preset Release
Expand All @@ -64,7 +66,7 @@ clean:
-find . -name '*~' -delete

distclean: # XXX clean
rm -rf build stagedir
rm -rf build stagedir .cache compile_commands.json

format:
git ls-files ::*.cmake ::*CMakeLists.txt | xargs gersemi -i
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ option(BUILD_SHARED_LIBS "Build shared libraries" NO)
set(BOOST_INCLUDE_LIBRARIES any pfr beast filesystem headers)
set(BOOST_USE_MODULES ON)
set(Boost_VERBOSE ON)
CPMAddPackage("gh:ClausKlein/boost-cmake#v1.90.0-rc2")
CPMAddPackage("gh:ClausKlein/boost-cmake#v1.91.0-rc1")

target_include_directories(
${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
Expand All @@ -41,8 +41,8 @@ Boost will automatically be downloaded from https://github.com/boostorg/boost/re
If that is not acceptable to you, you can use an alternate Boost version, apply
custom patches or just mirror the current archive in your internal network like so:
```
set(BOOST_URL http://internal.mirror/boost-1.90.0-cmake.7z)
set(BOOST_URL_SHA256 218e74c4aa362a994b7b7a23b2920f455a00205c656405fcf262cf60b8871921)
set(BOOST_URL http://internal.mirror/boost-1.91.0-1-cmake.7z)
set(BOOST_URL_SHA256 29c7d4f4ac36ad853b6765d03571ea60d90286775df026b4efd9f3281131972b)
```

If you have boost-cmake and Boost cmake sources files already available and want to point to them, you can use the following:
Expand Down Expand Up @@ -70,7 +70,7 @@ packageProject(
INCLUDE_HEADER_PATTERN "*.h"
DISABLE_VERSION_SUFFIX YES
COMPATIBILITY SameMajorVersion
DEPENDENCIES "Boost 1.90"
DEPENDENCIES "Boost 1.91"
)

include(CPack)
Expand Down
4 changes: 2 additions & 2 deletions cmake/CPM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors

set(CPM_DOWNLOAD_VERSION 0.42.0)
set(CPM_DOWNLOAD_VERSION 0.42.3)
set(CPM_HASH_SUM
"2020b4fc42dba44817983e06342e682ecfc3d2f484a581f11cc5731fbe4dce8a"
"a609e875fd532b067174250f6abbc3dac22fe2d64869783fb1e80bda1625c844"
)

if(CPM_SOURCE_CACHE)
Expand Down
24 changes: 24 additions & 0 deletions cmake/enable-experimental-import-std.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.3.0")
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD
"451f2fe2-a8a2-47c3-bc32-94786d8fc91b"
)
elseif(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30.0")
if(CMAKE_VERSION VERSION_LESS "3.31.8")
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD
"0e5b6991-d74f-4b3d-a41c-cf096e0b2508"
)
elseif(CMAKE_VERSION VERSION_LESS "4.0.0")
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD
"d0edc3af-4c50-42ea-a356-e2862fe7a444"
)
elseif(CMAKE_VERSION VERSION_LESS "4.0.3")
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD
"a9e1cf81-9932-4810-974b-6eccaf14e457"
)
elseif(CMAKE_VERSION VERSION_LESS "4.3.0")
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD
"d0edc3af-4c50-42ea-a356-e2862fe7a444"
)
endif()
endif()
Loading
Loading