diff --git a/.bumpversion.cfg b/.bumpversion.cfg index d7f61732..181bafe0 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -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.91.0-rc3 +current_version = 1.92.0-rc3 parse = (?P\d+)\.(?P\d+)\.(?P\d+)([-](?P(dev|rc))+(?P\d+))? serialize = {major}.{minor}.{patch}-{release}{build} @@ -27,8 +27,8 @@ serialize = {major}.{minor}.{patch} [bumpversion:file:CMakeLists.txt] -search = project(Boost-CMake LANGUAGES CXX VERSION {current_version}) -replace = project(Boost-CMake LANGUAGES CXX VERSION {new_version}) +search = project(Boost-CMake LANGUAGES C CXX VERSION {current_version}) +replace = project(Boost-CMake LANGUAGES C CXX VERSION {new_version}) parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\.(?P\d+))? serialize = {major}.{minor}.{patch}.{build} diff --git a/.bumpversion.md b/.bumpversion.md index fc8182de..9cc31044 100644 --- a/.bumpversion.md +++ b/.bumpversion.md @@ -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.91.0-rc0 release --no-commit --no-tag --allow-dirty + bumpversion --new-version 1.92.0-rc0 release --no-commit --no-tag --allow-dirty # Reference diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index c3979bb2..40cd6dba 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -22,33 +22,228 @@ env: CTEST_OUTPUT_ON_FAILURE: 1 jobs: - build: + unix: strategy: fail-fast: false matrix: - os: [macos-latest, ubuntu-26.04, windows-latest] + os: + - macos-latest + - ubuntu-26.04 - runs-on: ${{ matrix.os }} # -latest + compiler: + - llvm-22 + - gcc-16 + + variant: + - disabled_modules + - cxx_module + - cxx_module_std + + exclude: + - os: macos-latest + compiler: gcc-16 + variant: cxx_module_std + + name: ${{ matrix.os }} / ${{ matrix.compiler }} / ${{ matrix.variant }} + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + - name: Setup build environment uses: lukka/get-cmake@latest with: - cmakeVersion: "^4.3.4" + cmakeVersion: "^4.4.2" ninjaVersion: "~1.13.0" - - name: Setup MSVC - if: startsWith(matrix.os, 'windows') - uses: TheMrMilchmann/setup-msvc-dev@v4 - with: - arch: x64 - name: Setup Cpp - if: matrix.os != 'windows-latest' uses: aminya/setup-cpp@v1 with: - compiler: llvm-22 + compiler: ${{ matrix.compiler }} + + - name: Configure CMake custom preset + run: make ${{ matrix.variant }} + + - name: Diagnose GCC long long configuration + if: matrix.os == 'macos-latest' && matrix.compiler == 'gcc-16' + shell: bash + run: | + printf '#include \n' | + "${CXX}" \ + -std=c++23 -arch arm64 \ + -Ibuild/Release/_deps/boost-src/libs/config/include \ + -dM -E -x c++ - | + grep -E 'BOOST_(HAS|NO)_LONG_LONG|_GLIBCXX_USE_LONG_LONG|_GLIBCPP_USE_LONG_LONG|ULLONG_MAX' || + true + + printf '#include \n' | + "${CXX}" \ + -std=c++23 -arch arm64 \ + -dM -E -x c++ - | + grep -E 'ULLONG_MAX|ULONG_LONG_MAX|ULONGLONG_MAX' || + true + + printf '#include \nboost::ulong_long_type value{};\n' | + "${CXX}" \ + -std=c++23 -arch arm64 \ + -DBOOST_USE_MODULES \ + -Ibuild/Release/_deps/boost-src/libs/config/include \ + -fsyntax-only -x c++ - + + - name: Diagnose Boost long long configuration + if: matrix.os == 'macos-latest' && matrix.compiler == 'gcc-16' + shell: /bin/bash --noprofile --norc -e -o pipefail {0} + run: | + boost_source="${PWD}/build/Release/_deps/boost-src" + + boost_include_arguments=() + while IFS= read -r include_directory; do + boost_include_arguments+=("-I${include_directory}") + done < <( + find "${boost_source}/libs" \ + -mindepth 2 -maxdepth 2 \ + -type d -name include | + sort + ) + + printf '#include \nboost::ulong_long_type value{};\n' | + "${CXX}" \ + -std=c++23 -arch arm64 \ + -DBOOST_USE_MODULES \ + "${boost_include_arguments[@]}" \ + -fsyntax-only -x c++ - + + printf '#include \n' | + "${CXX}" \ + -std=c++23 -arch arm64 \ + -DBOOST_USE_MODULES \ + "${boost_include_arguments[@]}" \ + -fsyntax-only -x c++ - + + printf '#include \n' | + "${CXX}" \ + -std=c++23 -arch arm64 \ + -DBOOST_USE_MODULES \ + "${boost_include_arguments[@]}" \ + -fsyntax-only -x c++ - + + printf '#include \n' | + "${CXX}" \ + -std=c++23 -arch arm64 \ + -DBOOST_USE_MODULES \ + -DBOOST_CONTEXT_DYN_LINK= \ + -DBOOST_CONTEXT_EXPORT=EXPORT \ + -DBOOST_CONTEXT_NO_LIB= \ + -DBOOST_COROUTINES_DYN_LINK \ + -DBOOST_COROUTINES_SOURCE \ + -DBOOST_COROUTINE_DYN_LINK \ + -DBOOST_COROUTINE_NO_LIB \ + -DBOOST_COROUTINE_SOURCE \ + "${boost_include_arguments[@]}" \ + -fsyntax-only -x c++ - + + - name: Preprocess failing coroutine source + if: matrix.os == 'macos-latest' && matrix.compiler == 'gcc-16' + shell: /bin/bash --noprofile --norc -e -o pipefail {0} + run: | + boost_source="${PWD}/build/Release/_deps/boost-src" + source_file="${boost_source}/libs/coroutine/src/exceptions.cpp" + preprocessed="${RUNNER_TEMP}/boost-coroutine-exceptions.ii" + + definitions=( + -DBOOST_USE_MODULES + -DBOOST_CONTEXT_DYN_LINK= + -DBOOST_CONTEXT_EXPORT=EXPORT + -DBOOST_CONTEXT_NO_LIB= + -DBOOST_COROUTINES_DYN_LINK + -DBOOST_COROUTINES_SOURCE + -DBOOST_COROUTINE_DYN_LINK + -DBOOST_COROUTINE_NO_LIB + -DBOOST_COROUTINE_SOURCE + -Dboost_coroutine_EXPORTS + ) + + includes=( + "-I${boost_source}/libs/coroutine/include" + -isystem "${boost_source}/libs/assert/include" + -isystem "${boost_source}/libs/config/include" + -isystem "${boost_source}/libs/context/include" + -isystem "${boost_source}/libs/core/include" + -isystem "${boost_source}/libs/throw_exception/include" + -isystem "${boost_source}/libs/mp11/include" + -isystem "${boost_source}/libs/pool/include" + -isystem "${boost_source}/libs/integer/include" + -isystem "${boost_source}/libs/type_traits/include" + -isystem "${boost_source}/libs/winapi/include" + -isystem "${boost_source}/libs/predef/include" + -isystem "${boost_source}/libs/smart_ptr/include" + -isystem "${boost_source}/libs/exception/include" + -isystem "${boost_source}/libs/tuple/include" + -isystem "${boost_source}/libs/move/include" + -isystem "${boost_source}/libs/system/include" + -isystem "${boost_source}/libs/compat/include" + -isystem "${boost_source}/libs/variant2/include" + -isystem "${boost_source}/libs/utility/include" + -isystem "${boost_source}/libs/io/include" + -isystem "${boost_source}/libs/preprocessor/include" + ) + + "${CXX}" \ + "${definitions[@]}" \ + "${includes[@]}" \ + -fmodules-ts \ + -O3 -DNDEBUG -std=c++23 -arch arm64 -fPIC \ + -E "${source_file}" > "${preprocessed}" + + grep -n -C 3 \ + 'typedef unsigned long long ulong_long_type' \ + "${preprocessed}" || + true + + "${CXX}" \ + "${definitions[@]}" \ + "${includes[@]}" \ + -O3 -DNDEBUG -std=c++23 -arch arm64 -fPIC \ + -fmodules-ts \ + -dM -E "${source_file}" | + grep -E \ + 'BOOST_(HAS|NO)_LONG_LONG|_GLIBCXX_USE_LONG_LONG|_GLIBCPP_USE_LONG_LONG|ULLONG_MAX' || + true + + "${CXX}" \ + "${definitions[@]}" \ + "${includes[@]}" \ + -O3 -DNDEBUG -std=c++23 -arch arm64 -fPIC \ + -fmodules-ts \ + -fsyntax-only "${source_file}" || + true + + - name: Build CMake custom preset + run: make build + + - name: Install custom project + run: make install + + - name: Test custom examples + run: make ctest + + windows: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v6 + + - name: Setup build environment + uses: lukka/get-cmake@latest + with: + cmakeVersion: "^4.4.2" + ninjaVersion: "~1.13.0" + + - name: Setup MSVC + uses: TheMrMilchmann/setup-msvc-dev@v4 + with: + arch: x64 - name: Configure CMake run: cmake --preset ${{env.BUILD_TYPE}} --log-level=VERBOSE -D BOOST_USE_MODULES=ON diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5addb098..3253db06 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,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.5 + rev: v22.1.8 hooks: - id: clang-format types_or: [c++, c, json] exclude: docs/TODO.json - # # CMake linting and formatting + # CMake linting and formatting # - repo: https://github.com/BlankSpruce/gersemi - # rev: 0.27.7 + # rev: 0.28.1 # hooks: # - id: gersemi - # name: CMake linting + # args: ["--no-warn-about-unknown-commands", "--in-place"] # TODO: Markdown linting # Config file: .markdownlint.yaml @@ -37,7 +37,7 @@ repos: # - id: markdownlint - repo: https://github.com/codespell-project/codespell - rev: v2.4.2 + rev: v2.4.3 hooks: - id: codespell files: ^.*\.(cmake|cpp|hpp|txt|md|json|in|yaml|yml)$ diff --git a/CMakeLists.txt b/CMakeLists.txt index 252ad4e8..7279c29b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,43 @@ cmake_minimum_required(VERSION 3.30...4.4) -include(cmake/enable-experimental-import-std.cmake) +include(cmake/prelude.cmake) + +# CMake 4.4 does not record MSVC as supporting CXX26. Compiler detection occurs +# during project(), before CMAKE_CXX_COMPILER_ID is available, so temporarily +# allow standard decay and restore the requested strict setting afterward. +set(beman_bounds_test_restore_required OFF) +if( + CMAKE_VERSION VERSION_LESS 4.5 + AND CMAKE_CXX_STANDARD EQUAL 26 + AND (NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED OR CMAKE_CXX_STANDARD_REQUIRED) +) + set(beman_bounds_test_restore_required ON) + set(CMAKE_CXX_STANDARD_REQUIRED OFF) +endif() # gersemi: off -project(Boost-CMake LANGUAGES CXX VERSION 1.91.0.3) +project(Boost-CMake LANGUAGES C CXX VERSION 1.92.0.3) # gersemi: on +# Work around missing MSVC C++26 bookkeeping in CMake through version 4.4. +if(beman_bounds_test_restore_required) + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(CMAKE_CXX_STANDARD_REQUIRED OFF) + else() + set(CMAKE_CXX_STANDARD_REQUIRED ON) + endif() +endif() +unset(beman_bounds_test_restore_required) + +# Neither of these two are technically needed, but they make the expectation clear +if(NOT DEFINED CMAKE_CXX_EXTENSIONS) + set(CMAKE_CXX_EXTENSIONS OFF) +endif() + +if(NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +endif() + if(PROJECT_IS_TOP_LEVEL) option(BUILD_TESTING "Build the tests." OFF) if(UNIX) @@ -14,9 +46,7 @@ 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) - if(CMAKE_CXX_STANDARD GREATER_EQUAL 23) - set(CMAKE_CXX_MODULE_STD ON) - else() + if(NOT CMAKE_CXX_STANDARD GREATER_EQUAL 23) set(CMAKE_CXX_MODULE_STD OFF) endif() else() @@ -79,22 +109,40 @@ endif() set(BOOST_LIBS_REQUIRED headers) set(BOOST_EXCLUDE_LIBRARIES - any cobalt - contract # FIXME: deps on any! CK + dll # FIXME: use BOOST_USE_MODULES, but does not build! CK fiber + graph # FIXME: takes to long to build! CK 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(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if(BOOST_USE_MODULES) + # FIXME: stacktrace use private modules! CK + list(APPEND BOOST_EXCLUDE_LIBRARIES stacktrace) + # TODO: contract and program_options does not build with any module + # at least on APPLE with g++-16! + list(APPEND BOOST_EXCLUDE_LIBRARIES contract program_options) + endif() +endif() +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_MODULE_STD) + # FIXME: date_time library, deps on lexical_cast + # but asio, thread depends on date_time! + # and process on asio + # XXX list(APPEND BOOST_EXCLUDE_LIBRARIES lexical_cast date_time asio) +endif() +if(MSVC) + # FIXME: any, and stacktrace fails to build with modules on Windows! CK + list(APPEND BOOST_EXCLUDE_LIBRARIES stacktrace) + # TODO: contract and program_options does not build with any module + # on Windows + list(APPEND BOOST_EXCLUDE_LIBRARIES contract program_options) +endif() + if(PROJECT_IS_TOP_LEVEL AND NOT BOOST_BUILD_ALL) # NOTE: Compiled libs without warnings OSX with clang v22.1.7! CK list( @@ -103,25 +151,27 @@ if(PROJECT_IS_TOP_LEVEL AND NOT BOOST_BUILD_ALL) any # use BOOST_USE_MODULES, deps on type_index asio atomic - beast # deps on type_index + beast # NOTE: interface, but deps on type_index! CK + stacktrace # use BOOST_USE_MODULES chrono container - contract # TODO: deps on any! CK + contract # TODO(CK): library, deps on any! + conversion # use BOOST_USE_MODULES coroutine exception - filesystem # FIXME: Warnings with g++-15 on OSX! CK - geometry # deps on any - graph # TODO: deps on any, serialization! CK + filesystem # FIXME: Warnings with g++-16 on OSX! CK + geometry # NOTE: interface, but deps on any + graph # FIXME: deps on any, and serialization! CK json lexical_cast # use BOOST_USE_MODULES math optional - parser # deps on type_index + parser # interface, but deps on type_index! CK pfr # use BOOST_USE_MODULES process # deps on type_index - program_options # TODO: deps on any! CK - property_map # TODO: deps on any! CK - property_tree # TODO: deps on any! CK + program_options # TODO(CK): library, deps on any! + property_map # NOTE: interface, but deps on any! CK + property_tree # NOTE: interface, but deps on any! CK regex serialization signals2 @@ -140,91 +190,84 @@ else() list(APPEND BOOST_INCLUDE_LIBRARIES headers) list(REMOVE_DUPLICATES BOOST_INCLUDE_LIBRARIES) endif() +list(REMOVE_DUPLICATES BOOST_EXCLUDE_LIBRARIES) # ---- Add/prepare dependency handling via CPM ---- # see https://github.com/TheLartians/CPM.cmake for more info -set(BOOST_SUBDIR boost-1.91.0-1) +set(BOOST_SUBDIR boost-1.92.0) if(EXISTS "$ENV{CPM_SOURCE_CACHE}/${BOOST_SUBDIR}") set(FETCHCONTENT_SOURCE_DIR_BOOST "$ENV{CPM_SOURCE_CACHE}/${BOOST_SUBDIR}" CACHE PATH - "Boost source DIR" + "Boost cached source DIR" ) endif() if(FETCHCONTENT_SOURCE_DIR_BOOST) - set(CPM_Boost_SOURCE - ${FETCHCONTENT_SOURCE_DIR_BOOST} - CACHE PATH - "Manual override" - ) + set(CPM_Boost_SOURCE ${FETCHCONTENT_SOURCE_DIR_BOOST} CACHE PATH "CPM Manual override") endif() -set(BOOST_VERSION 1.91.0) -set(BOOST_FILE_VERSION ${BOOST_VERSION}-1) +set(BOOST_VERSION 1.92.0) +set(BOOST_FILE_VERSION ${BOOST_VERSION}) set(BOOST_URL "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 - "29c7d4f4ac36ad853b6765d03571ea60d90286775df026b4efd9f3281131972b" + "158852d45a7ce23de167a3dc2e57b04490829b233f06e835d5c81a65547ef68b" CACHE STRING "Boost download URL SHA256 checksum" ) +############################################################# +if( + APPLE + AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" + AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16 + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17 + AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm64|aarch64)$" +) + # FIXME: GCC 16 on Darwin ARM64 loses boost::ulong_long_type from + # Boost.Config when sources are compiled with -fmodules-ts. + add_compile_definitions(BOOST_HAS_LONG_LONG) +endif() +############################################################# + # ---- Add Boost source tar archive via FetchContent ---- include(FetchContent) +set(BOOST_PATCH_DIR "${CMAKE_CURRENT_SOURCE_DIR}/patches/${BOOST_VERSION}") +set(BOOST_PATCHES "${BOOST_PATCH_DIR}/TheBigBoost.patch") + FetchContent_Declare( Boost URL ${BOOST_URL} URL_HASH SHA256=${BOOST_URL_SHA256} - DOWNLOAD_EXTRACT_TIMESTAMP ON - PATCH_COMMAND - git apply -p0 - ${CMAKE_CURRENT_SOURCE_DIR}/patches/${BOOST_VERSION}/cmake-01.patch + PATCH_COMMAND git apply -p0 ${BOOST_PATCHES} SYSTEM ${EXCLUDE_FROM_ALL} ) -FetchContent_GetProperties(Boost) -if(NOT Boost_POPULATED) - message(STATUS "Fetching Boost") - FetchContent_MakeAvailable(Boost) - message(STATUS "Fetching Boost - done") - set(BOOST_SOURCE ${Boost_SOURCE_DIR}) - message(STATUS "Boost_SOURCE_DIR=${Boost_SOURCE_DIR}") -endif() - -# if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/patches/${BOOST_VERSION}) -# find_package(Patch REQUIRED) -# message(STATUS "Patch found: ${Patch_EXECUTABLE}") -# if( -# EXISTS -# ${CMAKE_CURRENT_SOURCE_DIR}/patches/${BOOST_VERSION}/cmake-01.patch -# ) -# message(STATUS "Patching Boost") -# execute_process( -# COMMAND -# ${Patch_EXECUTABLE} -N -p0 -i -# ${CMAKE_CURRENT_SOURCE_DIR}/patches/${BOOST_VERSION}/cmake-01.patch -# WORKING_DIRECTORY ${BOOST_SOURCE} -# COMMAND_ECHO STDOUT -# ) -# message(STATUS "Patching Boost - done") -# endif() -# endif() +FetchContent_MakeAvailable(Boost) +set(BOOST_SOURCE ${Boost_SOURCE_DIR}) +message(STATUS "Boost_SOURCE_DIR=${Boost_SOURCE_DIR}") +# TODO(CK): should be a function instead use of BOOST_SOURCE and BOOST_VERSION include(cmake/CheckBoostVersion.cmake) + message(STATUS "Boost found: ${BOOST_VERSION} ${BOOST_SOURCE}") +# TODO(CK): one possible workaround to not call the PATCH_COMMAND while each RERUN_CMAKE +set(FETCHCONTENT_SOURCE_DIR_BOOST + "${Boost_SOURCE_DIR}" + CACHE PATH + "Boost patched source DIR" + FORCE +) -include(cmake/ccache.cmake) +############################################################# -configure_file( - cmake/ccache.cmake - ${BOOST_SOURCE}/tools/cmake/include/ccache.cmake - COPYONLY -) +include(cmake/ccache.cmake) +configure_file(cmake/ccache.cmake ${BOOST_SOURCE}/tools/cmake/include/ccache.cmake COPYONLY) list(APPEND CMAKE_MODULE_PATH ${BOOST_SOURCE}/tools/cmake/include) include(BoostTestJamfile OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST) @@ -233,14 +276,19 @@ if(HAVE_BOOST_TEST) endif() ############################################################# + find_package(Threads) -# Compilation options required by all platforms +# Compilation options required for all platforms target_compile_definitions( boost_headers - INTERFACE $<$:BOOST_DISABLE_ASSERT> BOOST_ASIO_NO_DEPRECATED + INTERFACE + $<$:BOOST_DISABLE_ASSERT> + BOOST_ASIO_NO_DEPRECATED + BOOST_HAS_LONG_LONG ) target_link_libraries(boost_headers INTERFACE Threads::Threads) + ############################################################# # ---- usage example and test ---- @@ -258,5 +306,4 @@ endif() set(CPACK_GENERATOR "TGZ") include(CPack) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) include(AddUninstallTarget) diff --git a/CMakePresets.json b/CMakePresets.json index 84bfd04c..087e301e 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,10 +1,5 @@ { - "version": 7, - "cmakeMinimumRequired": { - "major": 3, - "minor": 27, - "patch": 0 - }, + "version": 12, "include": [ "CMakeReleasePresets.json" ], diff --git a/CMakeReleasePresets.json b/CMakeReleasePresets.json index 893c7eed..202519e4 100644 --- a/CMakeReleasePresets.json +++ b/CMakeReleasePresets.json @@ -1,10 +1,5 @@ { - "version": 7, - "cmakeMinimumRequired": { - "major": 3, - "minor": 27, - "patch": 0 - }, + "version": 12, "configurePresets": [ { "name": "Release", @@ -19,15 +14,20 @@ "value": "${sourceDir}/stagedir" }, "BOOST_BUILD_TESTING": true, - "BOOST_STANDALONE": true, + "BOOST_CONTAINER_HEADER_ONLY": true, + "BOOST_PROCESS_USE_STD_FS": true, + "BOOST_TEST_HEADERS_ONLY": true, + "BOOST_USE_MODULES": true, "BUILD_SHARED_LIBS": true, "CMAKE_BUILD_TYPE": "Release", "CMAKE_CXX_EXTENSIONS": false, - "CMAKE_CXX_STANDARD": "20", + "CMAKE_CXX_MODULE_STD": false, + "CMAKE_CXX_STANDARD": "23", "CMAKE_CXX_STANDARD_REQUIRED": true, "CMAKE_DEBUG_POSTFIX": "-d", "CMAKE_EXPORT_COMPILE_COMMANDS": true, "CMAKE_INSTALL_MESSAGE": "LAZY", + "CMAKE_MESSAGE_LOG_LEVEL": "VERBOSE", "CMAKE_SKIP_INSTALL_RULES": false }, "environment": { @@ -36,14 +36,14 @@ "PATH": "$env{HOME}/.local/bin${pathListSep}$penv{PATH}" }, "warnings": { - "dev": false, + "author": true, "deprecated": true, "uninitialized": true }, "trace": { "mode": "expand", "source": [ - "BoostRootNO.cmake", + "BoostRoot-NO!.cmake", "BoostTestJamfile.cmake", "BoostTest.cmake" ] @@ -53,26 +53,22 @@ "buildPresets": [ { "name": "Release", + "configuration": "Release", "configurePreset": "Release" }, { "name": "install", + "configuration": "Release", "configurePreset": "Release", "targets": [ "install" ] - }, - { - "name": "format", - "configurePreset": "Release", - "targets": [ - "fix-cmake-format" - ] } ], "testPresets": [ { "name": "Release", + "configuration": "Release", "configurePreset": "Release", "output": { "outputOnFailure": true diff --git a/GNUmakefile b/GNUmakefile index 66a69bb7..4ef61ec8 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,80 +1,136 @@ +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# # Standard stuff .SUFFIXES: MAKEFLAGS+= --no-builtin-rules +MAKEFLAGS+= --no-builtin-variables MAKEFLAGS+= --warn-undefined-variables -export hostSystemName=$(shell uname) - -ifeq (${hostSystemName},Darwin) - export LLVM_PREFIX:=$(shell brew --prefix llvm) - 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" - - ### 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++-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} - export CXX:=clang++-20 +##################################################################### + +export CMAKE_CONFIG_TYPE=Release +export CMAKE_CONFIGURATION_TYPES="Release;Debug" +export CMAKE_EXPORT_COMPILE_COMMANDS=YES +export CMAKE_GENERATOR=Ninja +# export CMAKE_INSTALL_PREFIX="${HOME}/.local" +# export CMAKE_PREFIX_PATH="${HOME}/.local" +export CTEST_OUTPUT_ON_FAILURE=YES + +##################################################################### + +export PATH:=${HOME}/.local/bin:${PATH} + +ifeq ($(origin CC),default) + export CC:= gcc-16 +endif + +ifeq ($(origin CXX),default) + export CXX:= g++-16 + # XXX export GCOV:="llvm-cov gcov" + # TODO: only needed to fix clang++ problem on infra-containers-clang + # export CXXFLAGS:= -stdlib=libc++ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 +endif + +# CXX_VERSION:=$(shell ${CXX} -dumpversion) +hostSystemName:=$(shell uname) + +ifeq (${hostSystemName},Linux) + export LANG:=C.UTF-8 + export LC_ALL:=C.UTF-8 endif +IMAGE?=ghcr.io/bemanproject/infra-containers-clang:latest + ##################################################################### -.PHONY: all fresh build test install examples format clean distclean -all: test +.PHONY: all cxx_module cxx_module_std disabled_modules build ctest install examples format clean distclean + +all: ctest ## Make all with cmake with cusomized workflow preset in verbose mode -examples: # XXX install - cmake -S examples -B build -G Ninja --log-level=VERBOSE --fresh \ - -D CMAKE_CXX_STDLIB_MODULES_JSON=${CMAKE_CXX_STDLIB_MODULES_JSON} \ - -D CMAKE_CXX_MODULE_STD=ON -D CMAKE_CXX_STANDARD=23 \ - -D BOOST_USE_MODULES=ON \ - --debug-find-pkg=Boost +# NOTE: Works only with clang v22.1.8 with different C++26 standard and cmake v4.4.x! CK +examples: # XXX install ## Build examples as standalone project to test installed config package + cmake -S examples -B build -G Ninja -D CMAKE_MESSAGE_LOG_LEVEL=VERBOSE --fresh \ + -D BOOST_USE_MODULES=ON \ + -D CMAKE_CXX_MODULE_STD=ON \ + -D CMAKE_CXX_STANDARD=26 \ + --debug-find-pkg=Boost ninja -C build test -v -fresh: - cmake --workflow --preset Release --fresh +cxx_module: CMakePresets.json ## Run cmake workflow preset Release with BOOST_USE_MODULES + cmake --preset Release --log-level=VERBOSE --fresh + ln -sf build/Release/compile_commands.json . + # TODO: cmake --workflow --preset Release --fresh +cxx_module_std: compile_commands.json ## Configure with CXX_MODULE_STD set in verbose mode 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 +# NOTE: Works only with clang v22.1.8 with this arguments and cmake v4.4.x! CK build/Release/compile_commands.json: GNUmakefile CMakeLists.txt - cmake --version - cmake --preset Release --log-level=VERBOSE -D BOOST_USE_MODULES=ON \ - -D CMAKE_CXX_STDLIB_MODULES_JSON=${CMAKE_CXX_STDLIB_MODULES_JSON} \ - -D CMAKE_CXX_MODULE_STD=OFF -D CMAKE_CXX_STANDARD=20 - -build: compile_commands.json + modules_json_option=""; \ + case "$${CXX##*/}" in \ + clang++|clang++-[0-9]*) \ + source_json=/lib/x86_64-linux-gnu/libc++.modules.json; \ + patched_json="$${PWD}/build/Release/libc++.modules.json"; \ + if test -r /etc/os-release && \ + grep -q '^ID=ubuntu$$' /etc/os-release && \ + test -n "$${CI:-}" && \ + test -n "$${LLVM_PATH:-}" && \ + test -r "$${source_json}"; then \ + mkdir -p "$${patched_json%/*}"; \ + sed -e "s#\\.\\./share/libc++#$${LLVM_PATH}/share/libc++#" \ + "$${source_json}" > "$${patched_json}"; \ + modules_json_option="-D CMAKE_CXX_STDLIB_MODULES_JSON=$${patched_json}"; \ + fi; \ + ;; \ + esac; \ + cmake --version; \ + cmake --preset Release --log-level=VERBOSE --fresh \ + -D BOOST_USE_MODULES=ON \ + -D CMAKE_CXX_MODULE_STD=ON \ + -D CMAKE_CXX_STANDARD=23 \ + $${modules_json_option} + +build: compile_commands.json ## Run build preset cmake --build --preset Release -test: install +ctest: install ## Run ctest preset ctest --preset Release -install: build - # XXX cmake --build --preset Release --target install - cmake --install build/Release --prefix=${HOME}/.local/ +install: build ## Install the cmake config package + cmake --build --preset Release --target install + # XXX cmake --install build/Release --config Release --prefix=${HOME}/.local/ -clean: - -cmake --build --preset Release --target clean - -find . -name '*~' -delete +clean: ## Clean build tree + -cmake --build --preset Release --target clean + +disabled_modules: ## Build with disabled CXX_SCAN_FOR_MODULES + cmake --preset Release --log-level=VERBOSE --fresh \ + -D BOOST_USE_MODULES=OFF \ + -D CMAKE_CXX_SCAN_FOR_MODULES=OFF -distclean: # XXX clean +distclean: ## Make it really clean rm -rf build stagedir .cache compile_commands.json + -find . -name '*~' -delete + +format: ## Format cmake and source files + git ls-files ::*.cmake ::*CMakeLists.txt | xargs gersemi -i --no-warn-about-unknown-commands --line-length 98 + -git ls-files ::*.json ::*.cpp ::*.hpp | xargs clang-format -i + +# Helper targets +.PHONY: env info dockerbuild + +dockerbuild: ## Start docker ${IMAGE} interactive + docker run -it -v $(CURDIR):/src $(IMAGE) + +env: ## Show env + $(foreach v, $(.VARIABLES), $(info $(v) = $($(v)))) + +info: ## Show this help. + @awk 'BEGIN {FS = ":.*?## "} /^[.a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort -format: - git ls-files ::*.cmake ::*CMakeLists.txt | xargs gersemi -i - git ls-files ::*.json ::*.cpp ::*.hpp | xargs clang-format -i - # git clang-format master +# Anything we don't know how to build will use this rule. +% :: + ninja -C build/Release $(@) diff --git a/README.md b/README.md index 4372b4b2..057bf9a8 100644 --- a/README.md +++ b/README.md @@ -20,15 +20,14 @@ include(GNUInstallDirs) include(cmake/CPM.cmake) 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.91.0-rc3") +CPMAddPackage("gh:ClausKlein/boost-cmake#v1.92.0-rc3") -target_include_directories( - ${PROJECT_NAME} PUBLIC $ - $) -... +add_libray(${PROJECT_NAME} my_sources.cpp) +# ... target_link_libraries(lib_using_filesystem PUBLIC Boost::filesystem) target_link_libraries(lib_using_header_only PUBLIC Boost::headers) @@ -41,8 +40,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.91.0-1-cmake.7z) -set(BOOST_URL_SHA256 29c7d4f4ac36ad853b6765d03571ea60d90286775df026b4efd9f3281131972b) +set(BOOST_URL http://internal.mirror/boost-1.92.0-cmake.7z) +set(BOOST_URL_SHA256 158852d45a7ce23de167a3dc2e57b04490829b233f06e835d5c81a65547ef68b) ``` If you have boost-cmake and Boost cmake sources files already available and want to point to them, you can use the following: @@ -70,7 +69,7 @@ packageProject( INCLUDE_HEADER_PATTERN "*.h" DISABLE_VERSION_SUFFIX YES COMPATIBILITY SameMajorVersion - DEPENDENCIES "Boost 1.91" + DEPENDENCIES "Boost 1.92" ) include(CPack) diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake index cf1772ed..7fef025f 100644 --- a/cmake/CPM.cmake +++ b/cmake/CPM.cmake @@ -2,23 +2,19 @@ # # SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors -set(CPM_DOWNLOAD_VERSION 0.42.3) -set(CPM_HASH_SUM - "a609e875fd532b067174250f6abbc3dac22fe2d64869783fb1e80bda1625c844" -) +set(CPM_DOWNLOAD_VERSION 0.43.1) +set(CPM_HASH_SUM "1c40fc102ce9625d7de7eb14f541cab30cc3138dca627f0b0ec40293ce6c2934") -if(CPM_SOURCE_CACHE) - set(CPM_DOWNLOAD_LOCATION - "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake" - ) +if(CPM_PATH) + set(CPM_DOWNLOAD_LOCATION "${CPM_PATH}/CPM.cmake") +elseif(DEFINED ENV{CPM_PATH}) + file(TO_CMAKE_PATH "$ENV{CPM_PATH}/CPM.cmake" CPM_DOWNLOAD_LOCATION) +elseif(CPM_SOURCE_CACHE) + set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") elseif(DEFINED ENV{CPM_SOURCE_CACHE}) - set(CPM_DOWNLOAD_LOCATION - "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake" - ) + set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") else() - set(CPM_DOWNLOAD_LOCATION - "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake" - ) + set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") endif() # Expand relative path. This is important if the provided path contains a tilde (~) diff --git a/cmake/PackageProject.cmake b/cmake/PackageProject.cmake index df8d090c..e2b25187 100644 --- a/cmake/PackageProject.cmake +++ b/cmake/PackageProject.cmake @@ -45,16 +45,13 @@ function(packageProject) endif() if(DEFINED PROJECT_VERSION_HEADER OR DEFINED PROJECT_EXPORT_HEADER) - set(PROJECT_VERSION_INCLUDE_DIR - ${PROJECT_BINARY_DIR}/PackageProjectInclude - ) + set(PROJECT_VERSION_INCLUDE_DIR ${PROJECT_BINARY_DIR}/PackageProjectInclude) if(DEFINED PROJECT_EXPORT_HEADER) include(GenerateExportHeader) generate_export_header( ${PROJECT_NAME} - EXPORT_FILE_NAME - ${PROJECT_VERSION_INCLUDE_DIR}/${PROJECT_EXPORT_HEADER} + EXPORT_FILE_NAME ${PROJECT_VERSION_INCLUDE_DIR}/${PROJECT_EXPORT_HEADER} ) endif() @@ -66,8 +63,7 @@ function(packageProject) unset(CMAKE_MATCH_7) string( - REGEX MATCH - "^([0-9]+)(\\.([0-9]+))?(\\.([0-9]+))?(\\.([0-9]+))?$" + REGEX MATCH "^([0-9]+)(\\.([0-9]+))?(\\.([0-9]+))?(\\.([0-9]+))?$" _ "${PROJECT_VERSION}" ) @@ -92,12 +88,7 @@ function(packageProject) string(TOUPPER ${PROJECT_NAME} UPPERCASE_PROJECT_NAME) # ensure that the generated macro does not include invalid characters - string( - REGEX REPLACE [^a-zA-Z0-9] - _ - UPPERCASE_PROJECT_NAME - ${UPPERCASE_PROJECT_NAME} - ) + string(REGEX REPLACE [^a-zA-Z0-9] _ UPPERCASE_PROJECT_NAME ${UPPERCASE_PROJECT_NAME}) configure_file( ${PACKAGE_PROJECT_ROOT_PATH}/version.h.in ${PROJECT_VERSION_INCLUDE_DIR}/${PROJECT_VERSION_HEADER} @@ -149,9 +140,7 @@ function(packageProject) # set default runtime install subdirectory (RUNTIME_DESTINATION) if(NOT DEFINED PROJECT_RUNTIME_DESTINATION) - set(PROJECT_RUNTIME_DESTINATION - ${PROJECT_NAME}${PROJECT_VERSION_SUFFIX} - ) + set(PROJECT_RUNTIME_DESTINATION ${PROJECT_NAME}${PROJECT_VERSION_SUFFIX}) endif() if(PROJECT_HEADER_SETS) @@ -246,9 +235,7 @@ function(packageProject) set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/README.md") - set(CPACK_RESOURCE_FILE_README - "${CMAKE_CURRENT_SOURCE_DIR}/README.md" - ) + set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") endif() set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) diff --git a/cmake/Toolchains/ios.cmake b/cmake/Toolchains/ios.cmake index 52f9044a..59f4cced 100644 --- a/cmake/Toolchains/ios.cmake +++ b/cmake/Toolchains/ios.cmake @@ -10,13 +10,9 @@ # If set manually, this will force the use of a specific SDK version set(IPHONEOS_DEPLOYMENT_TARGET 9.0) -set(CMAKE_C_FLAGS - "${CMAKE_C_FLAGS} -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}" -) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}" -) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") # Standard settings @@ -27,9 +23,7 @@ if(CMAKE_GENERATOR STREQUAL "Xcode") set(CMAKE_MACOSX_BUNDLE YES) endif() set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") -set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET - ${IPHONEOS_DEPLOYMENT_TARGET} -) +set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${IPHONEOS_DEPLOYMENT_TARGET}) # Setup iOS platform unless specified manually with IOS_PLATFORM if(NOT DEFINED IOS_PLATFORM) @@ -59,18 +53,10 @@ if(NOT CMAKE_IOS_SDK_ROOT) message(STATUS "Toolchain using default iOS SDK: ${CMAKE_IOS_SDK_ROOT}") endif() -set(CMAKE_IOS_SDK_ROOT - ${CMAKE_IOS_SDK_ROOT} - CACHE PATH - "Location of the selected iOS SDK" -) +set(CMAKE_IOS_SDK_ROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Location of the selected iOS SDK") # Set the sysroot default to the most recent SDK -set(CMAKE_OSX_SYSROOT - ${CMAKE_IOS_SDK_ROOT} - CACHE PATH - "Sysroot used for iOS support" -) +set(CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Sysroot used for iOS support") # set the architecture for iOS if(IOS_PLATFORM STREQUAL "OS") @@ -81,19 +67,10 @@ else() set(IOS_ARCH "i386;x86_64") endif() -set(CMAKE_OSX_ARCHITECTURES - "${IOS_ARCH}" - CACHE string - "Build architecture for iOS" -) +set(CMAKE_OSX_ARCHITECTURES "${IOS_ARCH}" CACHE string "Build architecture for iOS") set(CMAKE_ASM_FLAGS "" CACHE STRING "" FORCE) foreach(arch ${IOS_ARCH}) - set(CMAKE_ASM_FLAGS - "${CMAKE_ASM_FLAGS} -arch ${arch}" - CACHE STRING - "" - FORCE - ) + set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -arch ${arch}" CACHE STRING "" FORCE) endforeach() # Set the find root to the iOS developer roots and to user defined paths diff --git a/cmake/WarningsAsErrors.cmake b/cmake/WarningsAsErrors.cmake index 9bcbd768..2cedd425 100644 --- a/cmake/WarningsAsErrors.cmake +++ b/cmake/WarningsAsErrors.cmake @@ -1,7 +1,4 @@ -if( - CMAKE_CXX_COMPILER_ID MATCHES "Clang" - AND CMAKE_CXX_SIMULATE_ID MATCHES "MSVC" -) +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_SIMULATE_ID MATCHES "MSVC") target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX) elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") target_compile_options( @@ -9,14 +6,8 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") PRIVATE -Wall -Wextra -Wpedantic -Werror -Wshadow ) - if( - CMAKE_CXX_COMPILER_ID STREQUAL "Clang" - AND CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 10.0 - ) - target_compile_options( - ${PROJECT_NAME} - PRIVATE -Wdeprecated-copy-dtor -Wnewline-eof - ) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 10.0) + target_compile_options(${PROJECT_NAME} PRIVATE -Wdeprecated-copy-dtor -Wnewline-eof) endif() elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") string(REGEX REPLACE " /W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") diff --git a/cmake/ccache.cmake b/cmake/ccache.cmake index 09763822..2159a401 100644 --- a/cmake/ccache.cmake +++ b/cmake/ccache.cmake @@ -1,23 +1,18 @@ -find_program(CCACHE_BIN NAMES ccache sccache) -if(CCACHE_BIN) - set(CMAKE_CXX_COMPILER_LAUNCHER - ${CCACHE_BIN} - CACHE FILEPATH - "CXX compiler cache used" - ) - set(CMAKE_C_COMPILER_LAUNCHER - ${CCACHE_BIN} - CACHE FILEPATH - "C compiler cache used" - ) +set(is_ci FALSE) +if(DEFINED ENV{CI}) + set(is_ci "$ENV{CI}") +endif() + +if(NOT is_ci) + find_program(CCACHE_BIN NAMES ccache sccache) + if(CCACHE_BIN) + set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_BIN} CACHE FILEPATH "CXX compiler cache used") + set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_BIN} CACHE FILEPATH "C compiler cache used") - # ccache uses -I when compiling without preprocessor, which makes clang complain. - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics" - ) - set(CMAKE_C_FLAGS - "${CMAKE_C_FLAGS} -Qunused-arguments -fcolor-diagnostics" - ) + # ccache uses -I when compiling without preprocessor, which makes clang complain. + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments -fcolor-diagnostics") + endif() endif() endif() diff --git a/cmake/enable-experimental-import-std.cmake b/cmake/enable-experimental-import-std.cmake index 3c6d6887..7c8988d0 100644 --- a/cmake/enable-experimental-import-std.cmake +++ b/cmake/enable-experimental-import-std.cmake @@ -1,28 +1,16 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.4.0") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "f35a9ac6-8463-4d38-8eec-5d6008153e7d" - ) + set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "f35a9ac6-8463-4d38-8eec-5d6008153e7d") elseif(CMAKE_VERSION VERSION_GREATER_EQUAL "4.3.0") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "451f2fe2-a8a2-47c3-bc32-94786d8fc91b" - ) + 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" - ) + 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" - ) + 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" - ) + 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" - ) + set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "d0edc3af-4c50-42ea-a356-e2862fe7a444") endif() endif() diff --git a/cmake/prelude.cmake b/cmake/prelude.cmake new file mode 100644 index 00000000..25d9f7ca --- /dev/null +++ b/cmake/prelude.cmake @@ -0,0 +1,115 @@ +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +# This file must be included/used as CMAKE_PROJECT_TOP_LEVEL_INCLUDES -> before project() is called! +# + +# ---- The include guard applies globally to the whole build ---- +include_guard(GLOBAL) + +if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) + message( + FATAL_ERROR + "In-source builds are not supported. " + "Please read the BUILDING document before trying to build this project. " + "You may need to delete 'CMakeCache.txt' and 'CMakeFiles/' first." + ) +endif() + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +# gersemi: off +# --------------------------------------------------------------------------- +# The CMAKE_EXPERIMENTAL_CXX_IMPORT_STD is not longer needed except for OSX +# --------------------------------------------------------------------------- +if(CMAKE_VERSION VERSION_GREATER_EQUAL 4.5) + if(NOT UNIX) + return() + endif() +endif() +# --------------------------------------------------------------------------- + +# --------------------------------------------------------------------------- +# check if import std; is supported by CMAKE_CXX_COMPILER +# --------------------------------------------------------------------------- +if(CMAKE_VERSION VERSION_GREATER_EQUAL 4.2 AND CMAKE_VERSION VERSION_LESS 4.5) + if(PROJECT_NAME) + message( + WARNING + "This CMake file has to be included before first project() command call!" + ) + endif() +endif() +# gersemi: on + +include(${CMAKE_CURRENT_LIST_DIR}/enable-experimental-import-std.cmake) + +if(NOT UNIX) + return() +endif() + +# --------------------------------------------------------------------------- +# FIXME: clang++ we still needs to export CXX=clang++ +# --------------------------------------------------------------------------- +if("$ENV{CXX}" STREQUAL "" AND CMAKE_CXX_COMPILER) + message(WARNING "\$CXX is not set") + set(ENV{CXX} ${CMAKE_CXX_COMPILER}) +endif() + +# --------------------------------------------------------------------------- +# Workaround needed for CMAKE and clang++ to find the libc++.modules.json file +# --------------------------------------------------------------------------- +if( + CMAKE_VERSION VERSION_GREATER_EQUAL 4.2 + AND ("$ENV{CXX}" MATCHES "clang" OR CMAKE_CXX_COMPILER MATCHES "clang") +) + # NOTE: Always use libc++ + # see https://releases.llvm.org/19.1.0/projects/libcxx/docs/index.html + + if(APPLE) + set(ENV{CXXFLAGS} "-stdlib=libc++") + message(STATUS "CXXFLAGS=$ENV{CXXFLAGS}") + + execute_process( + OUTPUT_VARIABLE LLVM_PREFIX + COMMAND brew --prefix llvm + COMMAND_ECHO STDOUT + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + file(REAL_PATH ${LLVM_PREFIX} LLVM_DIR) + set(LLVM_DIR ${LLVM_DIR} CACHE FILEPATH "") + + message(STATUS "LLVM_DIR=${LLVM_DIR}") + add_link_options(-L${LLVM_DIR}/lib/c++) + include_directories(SYSTEM ${LLVM_DIR}/include) + + set(CMAKE_CXX_STDLIB_MODULES_JSON ${LLVM_DIR}/lib/c++/libc++.modules.json) + elseif(LINUX) + set(ENV{CXXFLAGS} "-stdlib=libc++ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0") + message(STATUS "CXXFLAGS=$ENV{CXXFLAGS}") + + execute_process( + OUTPUT_VARIABLE LLVM_MODULES + COMMAND clang++ -print-file-name=libc++.modules.json + COMMAND_ECHO STDOUT + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(NOT CMAKE_CXX_STDLIB_MODULES_JSON) + set(CMAKE_CXX_STDLIB_MODULES_JSON ${LLVM_MODULES}) + endif() + message(STATUS "CMAKE_CXX_STDLIB_MODULES_JSON=${CMAKE_CXX_STDLIB_MODULES_JSON}") + endif() + + if(EXISTS ${CMAKE_CXX_STDLIB_MODULES_JSON}) + file(REAL_PATH "${CMAKE_CXX_STDLIB_MODULES_JSON}" LLVM_MODULES) + message(STATUS "CMAKE_CXX_STDLIB_MODULES_JSON=${LLVM_MODULES}") + # gersemi: off + set(CACHE{CMAKE_CXX_STDLIB_MODULES_JSON} + TYPE FILEPATH + HELP "Result of: clang++ -print-file-name=libc++.modules.json" + VALUE ${LLVM_MODULES} + ) + # gersemi: on + else() + message(WARNING "File does NOT EXISTS! ${CMAKE_CXX_STDLIB_MODULES_JSON}") + endif() +endif() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 7db164fd..df00a52d 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required(VERSION 3.30...4.4) -include(../cmake/enable-experimental-import-std.cmake) +include(../cmake/prelude.cmake) -# test boost-cmake 1.91.0.3 -project(BoostExamples LANGUAGES CXX) +# test boost-cmake 1.92.0.3 +project(BoostExamples LANGUAGES CXX C) enable_testing() @@ -28,9 +28,7 @@ if(PROJECT_IS_TOP_LEVEL) endif() if(BOOST_USE_MODULES) set(CMAKE_CXX_SCAN_FOR_MODULES ON) - if(CMAKE_CXX_STANDARD GREATER_EQUAL 23) - set(CMAKE_CXX_MODULE_STD ON) - else() + if(NOT CMAKE_CXX_STANDARD GREATER_EQUAL 23) set(CMAKE_CXX_MODULE_STD OFF) endif() else() @@ -40,26 +38,46 @@ if(PROJECT_IS_TOP_LEVEL) block() set(BOOST_DEBUG YES) set(BOOST_VERBOSE YES) - list(APPEND BOOST_INCLUDE_LIBRARIES asio regex test) + list( + APPEND BOOST_INCLUDE_LIBRARIES + any + asio + conversion + lexical_cast + pfr + regex + type_index + stacktrace + test + ) set(CMAKE_SKIP_INSTALL_RULES ON) set(BUILD_SHARED_LIBS OFF) set(BOOST_SKIP_INSTALL_RULES ${CMAKE_SKIP_INSTALL_RULES}) - set(BOOST_VERSION 1.91.0) + set(BOOST_VERSION 1.92.0) include(FetchContent) FetchContent_Declare( Boost URL - https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}-1/boost-${BOOST_VERSION}-1-cmake.7z - URL_HASH - SHA256=29c7d4f4ac36ad853b6765d03571ea60d90286775df026b4efd9f3281131972b + https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION}-cmake.7z + URL_HASH SHA256=158852d45a7ce23de167a3dc2e57b04490829b233f06e835d5c81a65547ef68b EXCLUDE_FROM_ALL SYSTEM FIND_PACKAGE_ARGS ${BOOST_VERSION} - COMPONENTS any asio regex unit_test_framework + NO_SYSTEM_ENVIRONMENT_PATH + COMPONENTS + any + asio + conversion + lexical_cast + pfr + regex + type_index + stacktrace + unit_test_framework ) FetchContent_MakeAvailable(Boost) endblock() @@ -76,46 +94,87 @@ if(PROJECT_IS_TOP_LEVEL AND TARGET magic_enum::magic_enum) add_test(NAME BitManipulation COMMAND BitManipulation) endif() -if(BOOST_USE_MODULES AND TARGET Boost::any) - add_executable(ExampleModuleAny any_module_usage_sample.cpp) - target_link_libraries(ExampleModuleAny PRIVATE Boost::any) - add_test(NAME ExampleModuleAny COMMAND ExampleModuleAny) -endif() +function(boost_library_uses_modules boost_target result_variable) + if(NOT TARGET "${boost_target}") + set("${result_variable}" FALSE PARENT_SCOPE) + return() + endif() + + get_target_property( + interface_compile_definitions + "${boost_target}" + INTERFACE_COMPILE_DEFINITIONS + ) + + # NOTE: quotes needed here! CK + if("BOOST_USE_MODULES" IN_LIST interface_compile_definitions) + set("${result_variable}" TRUE PARENT_SCOPE) + message(STATUS "${boost_target} uses C++ modules") + else() + set("${result_variable}" FALSE PARENT_SCOPE) + message(WARNING "${boost_target} has no C++ modules") + endif() +endfunction() -add_executable(ExampleAsio deferred.cpp) -target_link_libraries(ExampleAsio PRIVATE Boost::asio) +function(add_boost_module_example example_name boost_target source_file) + if(NOT TARGET "${boost_target}") + message(WARNING "${boost_target} not found!") + return() + endif() + + boost_library_uses_modules("${boost_target}" __uses_modules) + if(__uses_modules) + add_executable("${example_name}" "${source_file}") + target_link_libraries("${example_name}" PRIVATE "${boost_target}") + add_test(NAME "${example_name}" COMMAND "${example_name}") + endif() +endfunction() + +function(add_boost_example example_name boost_target source_file) + if(NOT TARGET "${boost_target}") + return() + endif() + + add_executable("${example_name}" "${source_file}") + target_link_libraries("${example_name}" PRIVATE "${boost_target}") + add_test(NAME "${example_name}" COMMAND "${example_name}") +endfunction() + +# NOTE: needed in case of standalone build without cxx_modules! CK +if(BOOST_USE_MODULES) + add_boost_module_example(ExampleAny Boost::any any_module_usage_sample.cpp) + add_boost_module_example(ExampleConversion Boost::conversion conversion_usage_sample.cpp) + add_boost_module_example(ExampleLexical_cast Boost::lexical_cast lexical_cast_usage_sample.cpp) + add_boost_module_example(ExampleStacktrace Boost::stacktrace stacktrace_usage_sample.cpp) + add_boost_module_example(ExampleType_index Boost::type_index type_index_usage_sample.cpp) + add_boost_module_example(ExamplePfr Boost::pfr pfr_usage_sample.cpp) +endif() -add_executable(ExampleRegex regex.cpp) -target_link_libraries(ExampleRegex PRIVATE Boost::regex) +add_boost_example(ExampleAsio Boost::asio asio_deferred.cpp) +add_boost_example(ExampleRegex Boost::regex regex.cpp) -if(TARGET Boost::unit_test_framework) - add_executable(ExampleTest const_string_test.cpp) - target_link_libraries(ExampleTest PRIVATE Boost::unit_test_framework) - add_test(NAME ExampleTest COMMAND ExampleTest) +if(APPLE) + add_boost_example(ExampleUnit_test_framework Boost::unit_test_framework const_string_test.cpp) endif() # ---- Testing ---- -add_test(NAME ExampleAsio COMMAND ExampleAsio) -add_test(NAME ExampleRegex COMMAND ExampleRegex) - # test if the targets are findable from the build directory if(NOT PROJECT_IS_TOP_LEVEL) add_test( NAME find-package-test COMMAND - ${CMAKE_CTEST_COMMAND} - # --verbose - --output-on-failure -C $ --build-and-test - "${CMAKE_CURRENT_SOURCE_DIR}" - "${CMAKE_CURRENT_BINARY_DIR}/find-package-test" --build-generator - ${CMAKE_GENERATOR} --build-makeprogram ${CMAKE_MAKE_PROGRAM} - --build-options "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" + ${CMAKE_CTEST_COMMAND} --output-on-failure -C $ # + --build-and-test "${CMAKE_CURRENT_SOURCE_DIR}" + "${CMAKE_CURRENT_BINARY_DIR}/find-package-test" # + --build-generator "${CMAKE_GENERATOR}" # + --build-makeprogram "${CMAKE_MAKE_PROGRAM}" # + --build-options "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}" + "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" "-DCMAKE_CXX_MODULE_STD=${CMAKE_CXX_MODULE_STD}" "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}" "-DCMAKE_CXX_STDLIB_MODULES_JSON=${CMAKE_CXX_STDLIB_MODULES_JSON}" - "-DCMAKE_BUILD_TYPE=$" - "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" + "-DCMAKE_BUILD_TYPE=$" "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" "-DBOOST_USE_MODULES=${BOOST_USE_MODULES}" ) endif() diff --git a/examples/deferred.cpp b/examples/asio_deferred.cpp similarity index 78% rename from examples/deferred.cpp rename to examples/asio_deferred.cpp index a3d56d8d..984f9d12 100644 --- a/examples/deferred.cpp +++ b/examples/asio_deferred.cpp @@ -2,7 +2,7 @@ // deferred_1.cpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2026 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -13,7 +13,7 @@ using boost::asio::deferred; -int main() { +auto main() -> int { boost::asio::io_context ctx; boost::asio::steady_timer timer(ctx); @@ -21,7 +21,7 @@ int main() { auto deferred_op = timer.async_wait(deferred); - std::move(deferred_op)([](boost::system::error_code ec) { + std::move(deferred_op)([](boost::system::error_code ec) -> void { std::cout << "timer wait finished: " << ec.message() << "\n"; }); diff --git a/examples/conversion_usage_sample.cpp b/examples/conversion_usage_sample.cpp new file mode 100644 index 00000000..fd810527 --- /dev/null +++ b/examples/conversion_usage_sample.cpp @@ -0,0 +1,37 @@ +// Copyright (c) 2025-2026 Antony Polukhin +// Copyright (c) 2025-2026 Fedor Osetrov +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include + +import boost.conversion; + +namespace { + + struct Base { + virtual ~Base() = default; + [[nodiscard]] virtual auto name() const -> std::string { + return "base"; + } + }; + + struct Derived : Base { + [[nodiscard]] auto name() const -> std::string override { + return "derived"; + } + }; + +} // namespace + +auto main() -> int { + std::cerr << boost::implicit_cast(42) << '\n'; + + std::unique_ptr base = std::make_unique(); + std::cerr << boost::polymorphic_downcast(*base).name() << '\n'; + + return 0; +} diff --git a/examples/lexical_cast_usage_sample.cpp b/examples/lexical_cast_usage_sample.cpp new file mode 100644 index 00000000..a0312905 --- /dev/null +++ b/examples/lexical_cast_usage_sample.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2024-2025 Antony Polukhin +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// To compile manually use a command like the following: +// clang++ -std=c++20 -fmodule-file=lexical_cast.pcm lexical_cast.pcm usage_sample.cpp + +//[lexical_cast_module_example +#ifndef BOOST_LEXICAL_CAST_USE_STD_MODULE +# include // XXX to prevent g++-16 error: must ‘#include ’ before using ‘typeid’ +#endif + +import boost.lexical_cast; + +auto main() -> int { + return boost::lexical_cast("0"); +} +//] diff --git a/examples/main.cpp b/examples/main.cpp deleted file mode 100644 index bb73ac64..00000000 --- a/examples/main.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// -// timer.cpp -// ~~~~~~~~~ -// -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#include -#include -#include - -void print(const boost::system::error_code& /*e*/) { - std::cout << "Hello, world!" << std::endl; -} - -int main() { - boost::asio::io_service io; - - boost::asio::deadline_timer t(io, boost::posix_time::seconds(1)); - t.async_wait(&print); - - io.run(); - - return 0; -} diff --git a/examples/pfr_usage_sample.cpp b/examples/pfr_usage_sample.cpp new file mode 100644 index 00000000..349130a7 --- /dev/null +++ b/examples/pfr_usage_sample.cpp @@ -0,0 +1,30 @@ +// Copyright (c) 2016-2026 Antony Polukhin +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// To compile manually use a command like the following: +// clang++ -std=c++20 -fmodule-file=pfr.pcm pfr.pcm usage_sample.cpp + +//[pfr_module_example +#include +#include + +import boost.pfr; + +struct some_person { + std::string name; + unsigned birth_year; +}; + +int main() { + some_person val{"Edgar Allan Poe", 1809}; + + std::cout << boost::pfr::get<0>(val) // No macro! + << " was born in " << boost::pfr::get<1>(val); // Works with any aggregate! + + std::cout << '\n' << boost::pfr::io(val); // Outputs: {"Edgar Allan Poe", 1809} + std::cout << "\n." << boost::pfr::get_name<0, some_person>() << '=' << val.name + << '\n'; // Outputs: .name=Edgar Allan Poe +} +//] diff --git a/examples/regex.cpp b/examples/regex.cpp index 75a1bbe3..07634782 100644 --- a/examples/regex.cpp +++ b/examples/regex.cpp @@ -3,7 +3,7 @@ #include #include -int main() { +auto main() -> int { using namespace boost; std::string s @@ -26,7 +26,7 @@ int main() { constexpr int N{6}; std::cout << "Words greater than " << N << " characters:\n"; for (sregex_iterator i = words_begin; i != words_end; ++i) { - smatch match = *i; + const smatch& match = *i; std::string match_str = match.str(); if (match_str.size() > N) { std::cout << " " << match_str << '\n'; diff --git a/examples/stacktrace_usage_sample.cpp b/examples/stacktrace_usage_sample.cpp new file mode 100644 index 00000000..01f3d606 --- /dev/null +++ b/examples/stacktrace_usage_sample.cpp @@ -0,0 +1,34 @@ +// Copyright Antony Polukhin, 2025-2026. +// Copyright Fedor Osetrov, 2025-2026. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +#ifdef STACKTRACE_MODULE +import STACKTRACE_MODULE; +#else +import boost.stacktrace; +#endif + +namespace { + + BOOST_NOINLINE void foo() { + auto trace = boost::stacktrace::stacktrace{}; + std::cerr << trace; + } + + BOOST_NOINLINE void bar() { + foo(); + } + +} // namespace + +auto main() -> int { + bar(); + + return 0; +} diff --git a/examples/type_index_usage_sample.cpp b/examples/type_index_usage_sample.cpp new file mode 100644 index 00000000..3e52f22c --- /dev/null +++ b/examples/type_index_usage_sample.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2016-2026 Antony Polukhin +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// To compile manually use a command like the following: +// clang++ -std=c++20 -fmodule-file=type_index.pcm type_index.pcm usage_sample.cpp + +//[type_index_module_example +#include + +import boost.type_index; + +auto main() -> int { + std::cout << boost::typeindex::type_id_with_cvr(); // Outputs: const int +} +//] diff --git a/patches/1.92.0/TheBigBoost.patch b/patches/1.92.0/TheBigBoost.patch new file mode 100644 index 00000000..a61b228d --- /dev/null +++ b/patches/1.92.0/TheBigBoost.patch @@ -0,0 +1,865 @@ +--- tools/cmake/include/BoostInstall.cmake.old 2026-08-20 18:18:48.000000000 +0200 ++++ tools/cmake/include/BoostInstall.cmake 2026-08-25 10:30:11.000000000 +0200 +@@ -3,7 +3,7 @@ + # Distributed under the Boost Software License, Version 1.0. + # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt + +-if(NOT CMAKE_VERSION VERSION_LESS 3.10) ++if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.10) + include_guard() + endif() + +@@ -337,6 +337,27 @@ + string(APPEND CONFIG_INSTALL_DIR "-static") + endif() + ++ set(__INSTALL_CXX_MODULES) ++ set(__EXPORT_CXX_MODULES_CONFIG_FILES) ++ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.28) ++ get_target_property(INTERFACE_CXX_MODULE_SETS ${LIB} INTERFACE_CXX_MODULE_SETS) ++ if(INTERFACE_CXX_MODULE_SETS) ++ boost_message(DEBUG "boost_install_target: '${__TARGET}' has INTERFACE_CXX_MODULE_SETS=${INTERFACE_CXX_MODULE_SETS}") ++ set(extrainstalldir "${CMAKE_INSTALL_DATADIR}/boost-${__VERSION}/${LIB}") ++ set(__INSTALL_CXX_MODULES FILE_SET ${INTERFACE_CXX_MODULE_SETS} DESTINATION ${extrainstalldir}) ++ set(__EXPORT_CXX_MODULES_CONFIG_FILES CXX_MODULES_DIRECTORY .) ++ endif() ++ endif() ++ ++ set(__INSTALL_HEADER_SETS) ++ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.23) ++ get_target_property(INTERFACE_HEADER_SETS ${LIB} INTERFACE_HEADER_SETS) ++ if(INTERFACE_HEADER_SETS) ++ boost_message(DEBUG "boost_install_target: '${__TARGET}' has INTERFACE_HEADER_SETS=${INTERFACE_HEADER_SETS}") ++ set(__INSTALL_HEADER_SETS FILE_SET ${INTERFACE_HEADER_SETS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/boost-${__VERSION}") ++ endif() ++ endif() ++ + install(TARGETS ${LIB} EXPORT ${LIB}-targets + # explicit destination specification required for 3.13, 3.14 no longer needs it + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" +@@ -344,8 +365,17 @@ + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + PRIVATE_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ++ # NOTE: explicit needed if used starting with cmake v3.28! ++ # optional install: FILE_SET CXX_MODULES DESTINATION "${CMAKE_INSTALL_DATADIR}" ++ ${__INSTALL_CXX_MODULES} ++ # NOTE: explicit needed if used starting with cmake v3.23! ++ # Any module files from C++ modules from PUBLIC sources in a file set ++ # of type CXX_MODULES will be installed to the given DESTINATION. ++ # optional install: FILE_SET HEADERS ++ ${__INSTALL_HEADER_SETS} + ) + ++ # TODO(CK): what is this for? + export(TARGETS ${LIB} NAMESPACE Boost:: FILE export/${LIB}-targets.cmake) + + if(MSVC) +@@ -353,7 +383,7 @@ + install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) + endif() + +- if(TYPE STREQUAL "STATIC_LIBRARY" AND NOT CMAKE_VERSION VERSION_LESS 3.15) ++ if(TYPE STREQUAL "STATIC_LIBRARY" AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.15) + install(FILES "$/$$.pdb" DESTINATION ${CMAKE_INSTALL_LIBDIR} OPTIONAL) + endif() + endif() +@@ -362,7 +392,11 @@ + __boost_install_update_sources(${LIB} ${__EXTRA_DIRECTORY} ${__EXTRA_INSTALL_DIRECTORY}) + endif() + +- install(EXPORT ${LIB}-targets DESTINATION "${CONFIG_INSTALL_DIR}" NAMESPACE Boost:: FILE ${LIB}-targets.cmake) ++ install(EXPORT ${LIB}-targets DESTINATION "${CONFIG_INSTALL_DIR}" NAMESPACE Boost:: FILE ${LIB}-targets.cmake ++ # NOTE: explicit needed if used starting with cmake v3.28! ++ # optional install config packages for: FILE_SET CXX_MODULES ++ ${__EXPORT_CXX_MODULES_CONFIG_FILES} ++ ) + + set_target_properties(${LIB} PROPERTIES _boost_is_installed ON) + +@@ -491,7 +525,7 @@ + + # Header-only libraries are architecture-independent + +- if(NOT CMAKE_VERSION VERSION_LESS 3.14) ++ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.14) + + write_basic_package_version_file("${CONFIG_VERSION_FILE_NAME}" COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT) + +@@ -589,6 +623,7 @@ + + endif() + ++ set(extrainstalldir) + if(__EXTRA_DIRECTORY AND NOT BOOST_SKIP_INSTALL_RULES AND NOT CMAKE_SKIP_INSTALL_RULES) + + # Extract the library name from the path, one component up from the extra directory +--- tools/cmake/include/BoostRoot.cmake.old 2026-08-20 18:44:31.506539647 +0200 ++++ tools/cmake/include/BoostRoot.cmake 2026-08-17 16:46:20.302542033 +0200 +@@ -123,7 +123,9 @@ + set(BOOST_SKIP_INSTALL_RULES ON) + endif() + +- set(BUILD_TESTING OFF) ++ if(NOT BOOST_BUILD_TESTING) ++ set(BUILD_TESTING OFF) ++ endif() + + endif() + +@@ -303,6 +305,9 @@ + + endmacro() + ++# C++20 modules ++option(BOOST_USE_MODULES "Build Boost as a collection of C++20 modules (unstable)" OFF) ++ + # + + file(GLOB __boost_libraries RELATIVE "${BOOST_SUPERPROJECT_SOURCE_DIR}/libs" "${BOOST_SUPERPROJECT_SOURCE_DIR}/libs/*/CMakeLists.txt" "${BOOST_SUPERPROJECT_SOURCE_DIR}/libs/numeric/*/CMakeLists.txt") +--- libs/serialization/CMakeLists.txt.old 2026-08-19 11:08:14.000000000 +0200 ++++ libs/serialization/CMakeLists.txt 2026-08-17 16:46:20.302748163 +0200 +@@ -6,6 +6,8 @@ + + project(boost_serialization VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) + ++set(CMAKE_UNITY_BUILD OFF) ++ + add_library(boost_serialization + src/archive_exception.cpp + src/basic_archive.cpp +--- libs/any/CMakeLists.txt.old 2026-08-18 19:27:38.000000000 +0200 ++++ libs/any/CMakeLists.txt 2026-08-21 13:15:12.036761186 +0200 +@@ -2,25 +2,25 @@ + # Distributed under the Boost Software License, Version 1.0. + # See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt + +-cmake_minimum_required( VERSION 3.8...3.31 ) ++cmake_minimum_required(VERSION 3.8...4.4) + project( boost_any VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX ) + +-if (BOOST_USE_MODULES) +- add_library(boost_any) ++if(BOOST_USE_MODULES) ++ add_library(boost_any STATIC) + target_sources(boost_any PUBLIC +- FILE_SET modules_public +- TYPE CXX_MODULES ++ FILE_SET CXX_MODULES ++ BASE_DIRS modules + FILES modules/boost_any.cppm + ) + + target_compile_features(boost_any PUBLIC cxx_std_20) + target_compile_definitions(boost_any PUBLIC BOOST_USE_MODULES) +- set(__boost_cxx_standard ${CMAKE_CXX_STANDARD}) +- if (NOT __boost_cxx_standard) +- set(__boost_cxx_standard 20) ++ if(NOT CMAKE_CXX_STANDARD) ++ set(CMAKE_CXX_STANDARD 20) + endif() +- if (CMAKE_CXX_COMPILER_IMPORT_STD AND ${__boost_cxx_standard} IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) +- target_compile_definitions(boost_any PRIVATE BOOST_ANY_USE_STD_MODULE) ++ if(CMAKE_CXX_MODULE_STD AND CMAKE_CXX_STANDARD IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) ++ target_compile_definitions(boost_any PUBLIC BOOST_ANY_USE_STD_MODULE) ++ target_compile_features(boost_any PUBLIC cxx_std_23) + message(STATUS "Using `import std;`") + else() + message(STATUS "`import std;` is not available") +--- libs/any/test/cmake_subdir_test/CMakeLists.txt.old 2026-08-25 19:10:14.976204000 +0200 ++++ libs/any/test/cmake_subdir_test/CMakeLists.txt 2026-08-25 21:02:47.414261244 +0200 +@@ -2,28 +2,31 @@ + # Distributed under the Boost Software License, Version 1.0. + # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt + +-cmake_minimum_required(VERSION 3.5...4.0) ++cmake_minimum_required(VERSION 3.5...4.4) + + project(any_subdir_test LANGUAGES CXX) + + add_subdirectory(../../../assert boostorg/assert) +-add_subdirectory(../../../core boostorg/core) + add_subdirectory(../../../config boostorg/config) + add_subdirectory(../../../container_hash boostorg/container_hash) ++add_subdirectory(../../../core boostorg/core) + add_subdirectory(../../../describe boostorg/describe) + add_subdirectory(../../../detail boostorg/detail) + add_subdirectory(../../../integer boostorg/integer) + add_subdirectory(../../../mp11 boostorg/mp11) ++add_subdirectory(../../../predef boostorg/predef) + add_subdirectory(../../../preprocessor boostorg/preprocessor) ++add_subdirectory(../../../smart_ptr boostorg/smart_ptr) + add_subdirectory(../../../throw_exception boostorg/throw_exception) + add_subdirectory(../../../type_index boostorg/type_index) + add_subdirectory(../../../type_traits boostorg/type_traits) ++add_subdirectory(../../../unordered boostorg/unordered) + + add_subdirectory(../../ boostorg/any) + + enable_testing() + +-if (BOOST_USE_MODULES) ++if(BOOST_USE_MODULES) + add_executable(boost_any_module_usage ../../modules/usage_sample.cpp) + target_link_libraries(boost_any_module_usage PRIVATE Boost::any) + add_test(NAME boost_any_module_usage COMMAND boost_any_module_usage) +@@ -46,7 +49,7 @@ + # any_test.cpp # Ambiguous with modules, because all the anys now available + ) + +-foreach (testsourcefile ${RUN_TESTS_SOURCES}) ++foreach(testsourcefile ${RUN_TESTS_SOURCES}) + get_filename_component(testname ${testsourcefile} NAME_WLE) + add_executable(${PROJECT_NAME}_${testname} ../${testsourcefile}) + target_link_libraries(${PROJECT_NAME}_${testname} Boost::any Boost::core) +--- libs/conversion/CMakeLists.txt.old 2026-08-18 18:13:14.105023000 +0200 ++++ libs/conversion/CMakeLists.txt 2026-08-21 13:09:29.125413790 +0200 +@@ -4,23 +4,23 @@ + # Distributed under the Boost Software License, Version 1.0. + # See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt + +-cmake_minimum_required(VERSION 3.5...4.20) ++cmake_minimum_required(VERSION 3.5...4.4) ++ + project(boost_conversion VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) + +-if (BOOST_USE_MODULES) +- add_library(boost_conversion) ++if(BOOST_USE_MODULES) ++ add_library(boost_conversion STATIC) + target_sources(boost_conversion PUBLIC +- FILE_SET modules_public +- TYPE CXX_MODULES +- BASE_DIRS modules +- FILES ${CMAKE_CURRENT_LIST_DIR}/modules/boost_conversion.cppm ++ FILE_SET CXX_MODULES ++ BASE_DIRS modules ++ FILES modules/boost_conversion.cppm + ) + + target_compile_definitions(boost_conversion PUBLIC BOOST_USE_MODULES) + get_property(__standard TARGET boost_conversion PROPERTY CXX_STANDARD) +- if (__standard IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD AND CMAKE_CXX_MODULE_STD) ++ if(__standard IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD AND CMAKE_CXX_MODULE_STD) + target_compile_features(boost_conversion PUBLIC cxx_std_23) +- target_compile_definitions(boost_conversion PRIVATE BOOST_CONVERSION_USE_STD_MODULE) ++ target_compile_definitions(boost_conversion PUBLIC BOOST_CONVERSION_USE_STD_MODULE) + message(STATUS "Using `import std;`") + else() + target_compile_features(boost_conversion PUBLIC cxx_std_20) +--- libs/dll/CMakeLists.txt.old 2026-08-18 17:46:16.508869000 +0200 ++++ libs/dll/CMakeLists.txt 2026-08-18 17:33:54.245209309 +0200 +@@ -5,7 +5,7 @@ + # Distributed under the Boost Software License, Version 1.0. + # https://www.boost.org/LICENSE_1_0.txt + +-cmake_minimum_required(VERSION 3.5...4.20) ++cmake_minimum_required(VERSION 3.5...4.4) + + project(boost_dll VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) + +@@ -51,14 +51,14 @@ + + # Default library + +-if (BOOST_USE_MODULES) ++if(BOOST_USE_MODULES) + add_library(boost_dll) + target_compile_definitions(boost_dll PUBLIC BOOST_USE_MODULES) + + get_property(__standard TARGET boost_dll PROPERTY CXX_STANDARD) +- if (__standard IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD AND CMAKE_CXX_MODULE_STD) ++ if(__standard IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD AND CMAKE_CXX_MODULE_STD) + target_compile_features(boost_dll PUBLIC cxx_std_23) +- target_compile_definitions(boost_dll PRIVATE BOOST_DLL_USE_STD_MODULE) ++ target_compile_definitions(boost_dll PUBLIC BOOST_DLL_USE_STD_MODULE) + message(STATUS "Using `import std;`") + else() + target_compile_features(boost_dll PUBLIC cxx_std_20) +@@ -80,7 +80,7 @@ + + add_library(Boost::dll ALIAS boost_dll) + target_include_directories(boost_dll ${__scope} include) +-if (BOOST_DLL_USE_STD_FS) ++if(BOOST_DLL_USE_STD_FS) + target_link_libraries(boost_dll ${__scope} Boost::dll_std_fs) + else() + target_link_libraries(boost_dll ${__scope} Boost::dll_boost_fs) +--- libs/lexical_cast/CMakeLists.txt.old 2026-08-17 21:14:44.138016000 +0200 ++++ libs/lexical_cast/CMakeLists.txt 2026-08-21 13:09:18.668146913 +0200 +@@ -3,22 +3,26 @@ + # Distributed under the Boost Software License, Version 1.0. + # https://www.boost.org/LICENSE_1_0.txt + +-cmake_minimum_required(VERSION 3.5...4.0) ++cmake_minimum_required(VERSION 3.5...4.4) + + project(boost_lexical_cast VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) + +- +-if (BOOST_USE_MODULES) +- add_library(boost_lexical_cast) ++if(BOOST_USE_MODULES) ++ add_library(boost_lexical_cast STATIC) + target_sources(boost_lexical_cast PUBLIC +- FILE_SET modules_public TYPE CXX_MODULES FILES +- ${CMAKE_CURRENT_LIST_DIR}/modules/boost_lexical_cast.cppm ++ FILE_SET CXX_MODULES ++ BASE_DIRS modules ++ FILES modules/boost_lexical_cast.cppm + ) + + target_compile_features(boost_lexical_cast PUBLIC cxx_std_20) + target_compile_definitions(boost_lexical_cast PUBLIC BOOST_USE_MODULES) +- if (CMAKE_CXX_COMPILER_IMPORT_STD) +- target_compile_definitions(boost_lexical_cast PRIVATE BOOST_LEXICAL_CAST_USE_STD_MODULE) ++ if(NOT CMAKE_CXX_STANDARD) ++ set(CMAKE_CXX_STANDARD 20) ++ endif() ++ if (CMAKE_CXX_MODULE_STD AND CMAKE_CXX_STANDARD IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) ++ target_compile_definitions(boost_lexical_cast PUBLIC BOOST_LEXICAL_CAST_USE_STD_MODULE) ++ target_compile_features(boost_lexical_cast PUBLIC cxx_std_23) + message(STATUS "Using `import std;`") + else() + message(STATUS "`import std;` is not available") +--- libs/pfr/CMakeLists.txt.old 2026-08-18 19:29:18.000000000 +0200 ++++ libs/pfr/CMakeLists.txt 2026-08-21 13:10:00.727689106 +0200 +@@ -4,20 +4,26 @@ + # Distributed under the Boost Software License, Version 1.0. + # https://www.boost.org/LICENSE_1_0.txt + +-cmake_minimum_required(VERSION 3.5...3.31) ++cmake_minimum_required(VERSION 3.28...4.4) + + project(boost_pfr VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) + +-if (BOOST_USE_MODULES) +- add_library(boost_pfr) ++if(BOOST_USE_MODULES) ++ add_library(boost_pfr STATIC) + target_sources(boost_pfr PUBLIC +- FILE_SET modules_public TYPE CXX_MODULES FILES modules/boost_pfr.cppm ++ FILE_SET CXX_MODULES ++ BASE_DIRS modules ++ FILES modules/boost_pfr.cppm + ) + + target_compile_features(boost_pfr PUBLIC cxx_std_20) + target_compile_definitions(boost_pfr PUBLIC BOOST_USE_MODULES) +- if (CMAKE_CXX_COMPILER_IMPORT_STD) +- target_compile_definitions(boost_pfr PRIVATE BOOST_PFR_USE_STD_MODULE) ++ if(NOT CMAKE_CXX_STANDARD) ++ set(CMAKE_CXX_STANDARD 20) ++ endif() ++ if(CMAKE_CXX_MODULE_STD AND CMAKE_CXX_STANDARD IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) ++ target_compile_definitions(boost_pfr PUBLIC BOOST_PFR_USE_STD_MODULE) ++ target_compile_features(boost_pfr PUBLIC cxx_std_23) + message(STATUS "Using `import std;`") + else() + message(STATUS "`import std;` is not available") +@@ -31,11 +37,11 @@ + add_library(Boost::pfr ALIAS boost_pfr) + + enable_testing() +-if (BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") ++if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") + add_subdirectory(test) + endif() + +-if (BOOST_USE_MODULES AND BUILD_TESTING) ++if(BOOST_USE_MODULES AND BUILD_TESTING) + add_executable(boost_pfr_module_usage modules/usage_sample.cpp) + target_link_libraries(boost_pfr_module_usage PRIVATE Boost::pfr) + add_test(NAME boost_pfr_module_usage COMMAND boost_pfr_module_usage) +--- libs/type_index/CMakeLists.txt.old 2026-08-17 21:36:16.377197000 +0200 ++++ libs/type_index/CMakeLists.txt 2026-08-21 13:10:17.933107868 +0200 +@@ -4,24 +4,26 @@ + # Distributed under the Boost Software License, Version 1.0. + # https://www.boost.org/LICENSE_1_0.txt + +-cmake_minimum_required(VERSION 3.5...4.20) ++cmake_minimum_required(VERSION 3.5...4.4) + + project(boost_type_index VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) + +-if (BOOST_USE_MODULES) +- add_library(boost_type_index) +- target_sources(boost_type_index +- PUBLIC ++if(BOOST_USE_MODULES) ++ add_library(boost_type_index STATIC) ++ target_sources(boost_type_index PUBLIC + FILE_SET CXX_MODULES +- BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" +- FILES "${CMAKE_CURRENT_SOURCE_DIR}/modules/boost_type_index.cppm" ++ BASE_DIRS modules ++ FILES "modules/boost_type_index.cppm" + ) + + target_compile_features(boost_type_index PUBLIC cxx_std_20) + target_compile_definitions(boost_type_index PUBLIC BOOST_USE_MODULES) +- if ((CMAKE_CXX_STANDARD IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) AND CMAKE_CXX_MODULE_STD) +- target_compile_features(boost_type_index PRIVATE cxx_std_23) +- target_compile_definitions(boost_type_index PRIVATE BOOST_TYPE_INDEX_USE_STD_MODULE) ++ if(NOT CMAKE_CXX_STANDARD) ++ set(CMAKE_CXX_STANDARD 20) ++ endif() ++ if(CMAKE_CXX_MODULE_STD AND CMAKE_CXX_STANDARD IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) ++ target_compile_features(boost_type_index PUBLIC cxx_std_23) ++ target_compile_definitions(boost_type_index PUBLIC BOOST_TYPE_INDEX_USE_STD_MODULE) + message(STATUS "Using `import std;`") + else() + message(STATUS "`import std;` is not available") +--- libs/any/modules/boost_any.cppm.old 2026-08-22 21:56:56.328322891 +0200 ++++ libs/any/modules/boost_any.cppm 2026-08-22 21:17:53.838820112 +0200 +@@ -11,7 +11,9 @@ + #include + #include + #include +-#include ++ ++// Any-specific global module fragment includes. ++// Do not include here! + + #ifdef BOOST_ANY_USE_STD_MODULE + import std; +@@ -27,6 +29,8 @@ + + export module boost.any; + ++import boost.type_index; ++ + #ifdef __clang__ + # pragma clang diagnostic ignored "-Winclude-angled-in-module-purview" + #endif +--- libs/lexical_cast/include/boost/lexical_cast/detail/lcast_precision.hpp.old 2026-08-19 07:56:48.000000000 +0200 ++++ libs/lexical_cast/include/boost/lexical_cast/detail/lcast_precision.hpp 2026-08-19 08:19:30.055994324 +0200 +@@ -10,6 +10,8 @@ + + #include + ++#include // ULONG_MAX ++ + #if !defined(BOOST_USE_MODULES) || defined(BOOST_LEXICAL_CAST_INTERFACE_UNIT) + + #ifndef BOOST_LEXICAL_CAST_INTERFACE_UNIT +@@ -18,9 +20,8 @@ + # pragma once + #endif + +-#include + #include +-#include ++#include + + #endif // #ifndef BOOST_LEXICAL_CAST_INTERFACE_UNIT + +--- libs/lexical_cast/include/boost/lexical_cast/detail/lcast_unsigned_converters.hpp.old 2026-08-19 07:24:00.637556000 +0200 ++++ libs/lexical_cast/include/boost/lexical_cast/detail/lcast_unsigned_converters.hpp 2026-08-19 08:17:06.236665016 +0200 +@@ -20,6 +20,8 @@ + + #include + ++#include // CHAR_MAX ++ + #if !defined(BOOST_USE_MODULES) || defined(BOOST_LEXICAL_CAST_INTERFACE_UNIT) + + #ifndef BOOST_LEXICAL_CAST_INTERFACE_UNIT +@@ -28,7 +30,6 @@ + # pragma once + #endif + +-#include + #include + #include + #include +--- libs/pfr/include/boost/pfr/detail/io.hpp.old 2026-08-19 13:14:43.547240000 +0200 ++++ libs/pfr/include/boost/pfr/detail/io.hpp 2026-08-19 13:16:03.424081168 +0200 +@@ -51,6 +51,7 @@ + struct print_impl { + template + static void print (Stream& out, const T& value) { ++ using std::operator<<; + if (!!I) out << ", "; + out << detail::quoted_helper(boost::pfr::detail::sequence_tuple::get(value)); + print_impl::print(out, value); +@@ -67,6 +68,7 @@ + struct read_impl { + template + static void read (Stream& in, const T& value) { ++ using std::operator>>; + char ignore = {}; + if (!!I) { + in >> ignore; +--- libs/stacktrace/CMakeLists.txt.old 2026-08-17 21:21:54.022237000 +0200 ++++ libs/stacktrace/CMakeLists.txt 2026-08-25 11:05:25.242001386 +0200 +@@ -3,7 +3,7 @@ + # Distributed under the Boost Software License, Version 1.0. + # https://www.boost.org/LICENSE_1_0.txt + +-cmake_minimum_required(VERSION 3.8...4.20) ++cmake_minimum_required(VERSION 3.8...4.4) + + project(boost_stacktrace VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) + +@@ -11,14 +11,14 @@ + target_sources(${name} + PUBLIC + FILE_SET CXX_MODULES +- BASE_DIRS "${CMAKE_CURRENT_LIST_DIR}/modules" +- FILES "${CMAKE_CURRENT_LIST_DIR}/modules/${name}.cppm" ++ BASE_DIRS modules ++ FILES "modules/${name}.cppm" + ) + target_compile_definitions(${name} PUBLIC BOOST_USE_MODULES) + + if(${import_std}) + target_compile_features(${name} PUBLIC cxx_std_23) +- target_compile_definitions(${name} PRIVATE BOOST_STACKTRACE_USE_STD_MODULE) ++ target_compile_definitions(${name} PUBLIC BOOST_STACKTRACE_USE_STD_MODULE) + else() + target_compile_features(${name} PUBLIC cxx_std_20) + endif() +@@ -55,7 +55,7 @@ + ${defs} + ) + +- if (add_module) ++ if(add_module) + stacktrace_add_module(boost_stacktrace_${suffix} ${import_std}) + else() + target_sources(boost_stacktrace_${suffix} +@@ -99,7 +99,7 @@ + stacktrace_check(BOOST_STACKTRACE_HAS_WINDBG_CACHED has_windbg_cached.cpp "${CMAKE_CURRENT_SOURCE_DIR}/../config/include" "dbgeng;ole32") + + set(_default_from_exception ON) +-if (CMAKE_CXX_PLATFORM_ID MATCHES "Cygwin") ++if(CMAKE_CXX_PLATFORM_ID MATCHES "Cygwin") + set(_default_from_exception OFF) + endif() + +@@ -139,7 +139,7 @@ + if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 20) + endif() +- if ((CMAKE_CXX_STANDARD IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) AND CMAKE_CXX_MODULE_STD) ++ if((CMAKE_CXX_STANDARD IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) AND CMAKE_CXX_MODULE_STD) + message(STATUS "Using `import std;`") + set(__import_std ON) + else() +@@ -163,12 +163,12 @@ + # boost_stacktrace, default library + + if(BOOST_USE_MODULES) +- add_library(boost_stacktrace) ++ add_library(boost_stacktrace STATIC) + stacktrace_add_module(boost_stacktrace ${__import_std}) + set(__scope PUBLIC) + + foreach(backend noop backtrace addr2line basic windbg windbg_cached) +- if (TARGET boost_stacktrace_${backend}) ++ if(TARGET boost_stacktrace_${backend}) + target_compile_definitions(boost_stacktrace_${backend} INTERFACE BOOST_STACKTRACE_BACKEND_MODULE=${backend}) + endif() + endforeach() +--- libs/stacktrace/test/test.cpp.old 2026-08-12 14:04:00.047147800 +0200 ++++ libs/stacktrace/test/test.cpp 2026-08-24 21:11:15.000000000 +0200 +@@ -85,7 +85,7 @@ + + BOOST_TEST(ss1.str().find(" 1# ") != std::string::npos); + BOOST_TEST(ss2.str().find(" 1# ") != std::string::npos); +- ++ + BOOST_TEST(ss1.str().find(" in ") != std::string::npos); + BOOST_TEST(ss2.str().find(" in ") != std::string::npos); + +@@ -212,7 +212,7 @@ + BOOST_TEST(fv); + if (i > 1 && i < min_size - 3) { // Begin ...and end of the trace may match, skipping + BOOST_TEST(st[i] != fv); +- ++ + #if !(defined(BOOST_STACKTRACE_TEST_NO_DEBUG_AT_ALL) && defined(BOOST_MSVC)) + // MSVC can not get function name withhout debug symbols even if it is exported + BOOST_TEST(st[i].name() != fv.name()); +@@ -276,7 +276,7 @@ + return static_cast(file_size); + } + +-uintptr_t get_address_from_frame(const std::string& frame) { ++std::uintptr_t get_address_from_frame(const std::string& frame) { + std::size_t address = 0; + std::string hex_address; + std::size_t pos = frame.find("0x"); +@@ -284,7 +284,7 @@ + if (pos != std::string::npos) { + // Extract the hex address substring + hex_address = frame.substr(pos + 2); // Skip "0x" +- ++ + // Convert hex string to std::size_t + std::stringstream ss; + ss << std::hex << hex_address; +@@ -295,7 +295,7 @@ + } + + void test_relative_virtual_address(const char* file_path) +-{ ++{ + const auto frame = to_string(boost::stacktrace::stacktrace(0, 1).as_vector().front()); + + // Skip the test if the frame does not contain an address +--- libs/stacktrace/include/boost/stacktrace/detail/libbacktrace_impls.hpp.old 2026-08-12 14:04:00.037349600 +0200 ++++ libs/stacktrace/include/boost/stacktrace/detail/libbacktrace_impls.hpp 2026-08-24 21:06:16.000000000 +0200 +@@ -35,7 +35,7 @@ + std::size_t line; + }; + +-inline void libbacktrace_syminfo_callback(void *data, uintptr_t /*pc*/, const char *symname, uintptr_t /*symval*/, uintptr_t /*symsize*/) { ++inline void libbacktrace_syminfo_callback(void *data, std::uintptr_t /*pc*/, const char *symname, std::uintptr_t /*symval*/, std::uintptr_t /*symsize*/) { + pc_data& d = *static_cast(data); + if (d.function && symname) { + *d.function = symname; +@@ -43,11 +43,11 @@ + } + + // Old versions of libbacktrace have different signature for the callback +-inline void libbacktrace_syminfo_callback(void *data, uintptr_t pc, const char *symname, uintptr_t symval) { ++inline void libbacktrace_syminfo_callback(void *data, std::uintptr_t pc, const char *symname, std::uintptr_t symval) { + boost::stacktrace::detail::libbacktrace_syminfo_callback(data, pc, symname, symval, 0); + } + +-inline int libbacktrace_full_callback(void *data, uintptr_t /*pc*/, const char *filename, int lineno, const char *function) { ++inline int libbacktrace_full_callback(void *data, std::uintptr_t /*pc*/, const char *filename, int lineno, const char *function) { + pc_data& d = *static_cast(data); + if (d.filename && filename) { + *d.filename = filename; +@@ -129,15 +129,15 @@ + if (state) { + ::backtrace_pcinfo( + state, +- reinterpret_cast(addr), ++ reinterpret_cast(addr), + boost::stacktrace::detail::libbacktrace_full_callback, + boost::stacktrace::detail::libbacktrace_error_callback, + &data +- ) ++ ) + || + ::backtrace_syminfo( + state, +- reinterpret_cast(addr), ++ reinterpret_cast(addr), + boost::stacktrace::detail::libbacktrace_syminfo_callback, + boost::stacktrace::detail::libbacktrace_error_callback, + &data +@@ -176,7 +176,7 @@ + if (state) { + ::backtrace_pcinfo( + state, +- reinterpret_cast(addr), ++ reinterpret_cast(addr), + boost::stacktrace::detail::libbacktrace_full_callback, + boost::stacktrace::detail::libbacktrace_error_callback, + &data +@@ -184,7 +184,7 @@ + || + ::backtrace_syminfo( + state, +- reinterpret_cast(addr), ++ reinterpret_cast(addr), + boost::stacktrace::detail::libbacktrace_syminfo_callback, + boost::stacktrace::detail::libbacktrace_error_callback, + &data +@@ -213,7 +213,7 @@ + if (state) { + ::backtrace_pcinfo( + state, +- reinterpret_cast(addr_), ++ reinterpret_cast(addr_), + boost::stacktrace::detail::libbacktrace_full_callback, + boost::stacktrace::detail::libbacktrace_error_callback, + &data +@@ -235,7 +235,7 @@ + if (state) { + ::backtrace_pcinfo( + state, +- reinterpret_cast(addr_), ++ reinterpret_cast(addr_), + boost::stacktrace::detail::libbacktrace_full_callback, + boost::stacktrace::detail::libbacktrace_error_callback, + &data +--- libs/stacktrace/include/boost/stacktrace/detail/addr_base.hpp.old 2026-08-20 10:23:42.511592557 +0200 ++++ libs/stacktrace/include/boost/stacktrace/detail/addr_base.hpp 2026-08-20 10:55:20.396558358 +0200 +@@ -15,25 +15,26 @@ + #if !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE) + #include + #include +-#include +-#include ++#include // std::uintptr_t ++#include ++#include + #endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE) + + namespace boost { namespace stacktrace { namespace detail { + + struct mapping_entry_t { +- uintptr_t start = 0; +- uintptr_t end = 0; +- uintptr_t offset_from_base = 0; ++ std::uintptr_t start = 0; ++ std::uintptr_t end = 0; ++ std::uintptr_t offset_from_base = 0; + + inline bool contains_addr(const void* addr) const { +- uintptr_t addr_uint = reinterpret_cast(addr); ++ std::uintptr_t addr_uint = reinterpret_cast(addr); + return addr_uint >= start && addr_uint < end; + } + }; + +-inline uintptr_t hex_str_to_int(const std::string& str) { +- uintptr_t out; ++inline std::uintptr_t hex_str_to_int(const std::string& str) { ++ std::uintptr_t out; + std::stringstream ss; + ss << std::hex << str; + ss >> out; +@@ -70,12 +71,12 @@ + mapping.end = hex_str_to_int(mapping_end_str); + mapping.offset_from_base = hex_str_to_int(offset_from_base_str); + return mapping; +- } catch(std::invalid_argument& e) { ++ } catch(const std::invalid_argument& e) { + return mapping_entry_t{}; + } + } + +-inline uintptr_t get_own_proc_addr_base(const void* addr) { ++inline std::uintptr_t get_own_proc_addr_base(const void* addr) { + std::ifstream maps_file("/proc/self/maps"); + for (std::string line; std::getline(maps_file, line); ) { + const mapping_entry_t mapping = parse_proc_maps_line(line); +--- libs/stacktrace/include/boost/stacktrace/detail/frame_unwind.ipp.old 2026-08-12 14:04:00.035337900 +0200 ++++ libs/stacktrace/include/boost/stacktrace/detail/frame_unwind.ipp 2026-08-20 10:21:50.242597642 +0200 +@@ -50,7 +50,7 @@ + Base::res = to_hex_array(addr).data(); + #else + const auto addr_base = boost::stacktrace::detail::get_own_proc_addr_base(addr); +- Base::res = to_hex_array(reinterpret_cast(addr) - addr_base).data(); ++ Base::res = to_hex_array(reinterpret_cast(addr) - addr_base).data(); + #endif + } + +--- libs/stacktrace/include/boost/stacktrace/detail/addr2line_impls.hpp.old 2026-08-19 11:39:49.341239746 +0200 ++++ libs/stacktrace/include/boost/stacktrace/detail/addr2line_impls.hpp 2026-08-20 10:21:50.194082770 +0200 +@@ -164,11 +164,11 @@ + } + + inline std::string source_location(const void* addr, bool position_independent) { +- uintptr_t addr_base = 0; ++ std::uintptr_t addr_base = 0; + if (position_independent) { + addr_base = boost::stacktrace::detail::get_own_proc_addr_base(addr); + } +- const void* offset = reinterpret_cast(reinterpret_cast(addr) - addr_base); ++ const void* offset = reinterpret_cast(reinterpret_cast(addr) - addr_base); + std::string source_line = boost::stacktrace::detail::addr2line("-Cpe", reinterpret_cast(offset)); + if (source_line.empty() || source_line[0] == '?') { + return ""; +@@ -211,11 +211,11 @@ + typedef to_string_impl_base to_string_impl; + + inline std::string name(const void* addr, bool position_independent) { +- uintptr_t addr_base = 0; ++ std::uintptr_t addr_base = 0; + if(position_independent){ + addr_base = boost::stacktrace::detail::get_own_proc_addr_base(addr); + } +- const void* offset = reinterpret_cast(reinterpret_cast(addr) - addr_base); ++ const void* offset = reinterpret_cast(reinterpret_cast(addr) - addr_base); + std::string res = boost::stacktrace::detail::addr2line("-fe", offset); + res = res.substr(0, res.find_last_of('\n')); + res = boost::core::demangle(res.c_str()); +@@ -238,11 +238,11 @@ + + inline std::string source_file(const void* addr, bool position_independent) { + std::string res; +- uintptr_t addr_base = 0; ++ std::uintptr_t addr_base = 0; + if(position_independent){ + addr_base = boost::stacktrace::detail::get_own_proc_addr_base(addr); + } +- const void* offset = reinterpret_cast(reinterpret_cast(addr) - addr_base); ++ const void* offset = reinterpret_cast(reinterpret_cast(addr) - addr_base); + res = boost::stacktrace::detail::addr2line("-e", offset); + res = res.substr(0, res.find_last_of(':')); + if (res == "??") { +@@ -254,11 +254,11 @@ + + inline std::size_t source_line(const void* addr, bool position_independent) { + std::size_t line_num = 0; +- uintptr_t addr_base = 0; ++ std::uintptr_t addr_base = 0; + if(position_independent){ + addr_base = boost::stacktrace::detail::get_own_proc_addr_base(addr); + } +- const void* offset = reinterpret_cast(reinterpret_cast(addr) - addr_base); ++ const void* offset = reinterpret_cast(reinterpret_cast(addr) - addr_base); + std::string res = boost::stacktrace::detail::addr2line("-e", offset); + const std::size_t last = res.find_last_of(':'); + if (last == std::string::npos) { +--- libs/stacktrace/include/boost/stacktrace/detail/frame_msvc.ipp.old 2026-08-12 14:04:00.035337900 +0200 ++++ libs/stacktrace/include/boost/stacktrace/detail/frame_msvc.ipp 2026-08-24 21:06:58.000000000 +0200 +@@ -262,7 +262,7 @@ + nullptr, + &base + )); +- ++ + if (res) { + name[0] = '\0'; + size = 0; +@@ -303,7 +303,7 @@ + } + else if (res && size > 1) { + module_name->assign(name, size - 1); +- } ++ } + } + } + +@@ -402,8 +402,8 @@ + res += to_hex_array(addr).data(); + #else + // Get own base address +- const uintptr_t base_addr = get_own_proc_addr_base(addr); +- res += to_hex_array(reinterpret_cast(addr) - base_addr).data(); ++ const std::uintptr_t base_addr = get_own_proc_addr_base(addr); ++ res += to_hex_array(reinterpret_cast(addr) - base_addr).data(); + #endif + } + +--- libs/stacktrace/modules/boost_stacktrace_dump.cppm.old 2026-08-19 18:02:37.092932000 +0200 ++++ libs/stacktrace/modules/boost_stacktrace_dump.cppm 2026-08-20 10:53:52.185787423 +0200 +@@ -15,13 +15,17 @@ + #include + + #if !defined(BOOST_STACKTRACE_USE_STD_MODULE) +-#include ++#include ++#include // std::uintptr_t + #endif + + #include +-#include + #include + ++#if !defined(BOOST_WINDOWS) ++# include ++#endif ++ + #define BOOST_STACKTRACE_INTERFACE_UNIT + #define BOOST_STACKTRACE_LINK + diff --git a/patches/1.92.0/boost-any.patch b/patches/1.92.0/boost-any.patch new file mode 100644 index 00000000..19cad678 --- /dev/null +++ b/patches/1.92.0/boost-any.patch @@ -0,0 +1,22 @@ +--- libs/any/modules/boost_any.cppm.old 2026-08-22 21:56:56.328322891 +0200 ++++ libs/any/modules/boost_any.cppm 2026-08-22 21:17:53.838820112 +0200 +@@ -11,7 +11,9 @@ + #include + #include + #include +-#include ++ ++// Any-specific global module fragment includes. ++// Do not include here! + + #ifdef BOOST_ANY_USE_STD_MODULE + import std; +@@ -27,6 +29,8 @@ + + export module boost.any; + ++import boost.type_index; ++ + #ifdef __clang__ + # pragma clang diagnostic ignored "-Winclude-angled-in-module-purview" + #endif diff --git a/patches/1.92.0/boost-lexical_cast-numeric_limits.patch b/patches/1.92.0/boost-lexical_cast-numeric_limits.patch new file mode 100644 index 00000000..aba9e4b5 --- /dev/null +++ b/patches/1.92.0/boost-lexical_cast-numeric_limits.patch @@ -0,0 +1,41 @@ +--- libs/lexical_cast/include/boost/lexical_cast/detail/lcast_precision.hpp.old 2026-08-19 07:56:48.000000000 +0200 ++++ libs/lexical_cast/include/boost/lexical_cast/detail/lcast_precision.hpp 2026-08-19 08:19:30.055994324 +0200 +@@ -10,6 +10,8 @@ + + #include + ++#include // ULONG_MAX ++ + #if !defined(BOOST_USE_MODULES) || defined(BOOST_LEXICAL_CAST_INTERFACE_UNIT) + + #ifndef BOOST_LEXICAL_CAST_INTERFACE_UNIT +@@ -18,9 +20,8 @@ + # pragma once + #endif + +-#include + #include +-#include ++#include + + #endif // #ifndef BOOST_LEXICAL_CAST_INTERFACE_UNIT + +--- libs/lexical_cast/include/boost/lexical_cast/detail/lcast_unsigned_converters.hpp.old 2026-08-19 07:24:00.637556000 +0200 ++++ libs/lexical_cast/include/boost/lexical_cast/detail/lcast_unsigned_converters.hpp 2026-08-19 08:17:06.236665016 +0200 +@@ -20,6 +20,8 @@ + + #include + ++#include // CHAR_MAX ++ + #if !defined(BOOST_USE_MODULES) || defined(BOOST_LEXICAL_CAST_INTERFACE_UNIT) + + #ifndef BOOST_LEXICAL_CAST_INTERFACE_UNIT +@@ -28,7 +30,6 @@ + # pragma once + #endif + +-#include + #include + #include + #include diff --git a/patches/1.92.0/boost-pfr-io.patch b/patches/1.92.0/boost-pfr-io.patch new file mode 100644 index 00000000..8f1e8cc8 --- /dev/null +++ b/patches/1.92.0/boost-pfr-io.patch @@ -0,0 +1,18 @@ +--- libs/pfr/include/boost/pfr/detail/io.hpp.old 2026-08-19 13:14:43.547240000 +0200 ++++ libs/pfr/include/boost/pfr/detail/io.hpp 2026-08-19 13:16:03.424081168 +0200 +@@ -51,6 +51,7 @@ + struct print_impl { + template + static void print (Stream& out, const T& value) { ++ using std::operator<<; + if (!!I) out << ", "; + out << detail::quoted_helper(boost::pfr::detail::sequence_tuple::get(value)); + print_impl::print(out, value); +@@ -67,6 +68,7 @@ + struct read_impl { + template + static void read (Stream& in, const T& value) { ++ using std::operator>>; + char ignore = {}; + if (!!I) { + in >> ignore; diff --git a/patches/1.92.0/boost-stacktrace.patch b/patches/1.92.0/boost-stacktrace.patch new file mode 100644 index 00000000..cdae1140 --- /dev/null +++ b/patches/1.92.0/boost-stacktrace.patch @@ -0,0 +1,372 @@ +--- libs/stacktrace/CMakeLists.txt.old 2026-08-17 21:21:54.022237000 +0200 ++++ libs/stacktrace/CMakeLists.txt 2026-08-25 11:05:25.242001386 +0200 +@@ -3,7 +3,7 @@ + # Distributed under the Boost Software License, Version 1.0. + # https://www.boost.org/LICENSE_1_0.txt + +-cmake_minimum_required(VERSION 3.8...4.20) ++cmake_minimum_required(VERSION 3.8...4.4) + + project(boost_stacktrace VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) + +@@ -11,14 +11,14 @@ + target_sources(${name} + PUBLIC + FILE_SET CXX_MODULES +- BASE_DIRS "${CMAKE_CURRENT_LIST_DIR}/modules" +- FILES "${CMAKE_CURRENT_LIST_DIR}/modules/${name}.cppm" ++ BASE_DIRS modules ++ FILES "modules/${name}.cppm" + ) + target_compile_definitions(${name} PUBLIC BOOST_USE_MODULES) + + if(${import_std}) + target_compile_features(${name} PUBLIC cxx_std_23) +- target_compile_definitions(${name} PRIVATE BOOST_STACKTRACE_USE_STD_MODULE) ++ target_compile_definitions(${name} PUBLIC BOOST_STACKTRACE_USE_STD_MODULE) + else() + target_compile_features(${name} PUBLIC cxx_std_20) + endif() +@@ -55,7 +55,7 @@ + ${defs} + ) + +- if (add_module) ++ if(add_module) + stacktrace_add_module(boost_stacktrace_${suffix} ${import_std}) + else() + target_sources(boost_stacktrace_${suffix} +@@ -99,7 +99,7 @@ + stacktrace_check(BOOST_STACKTRACE_HAS_WINDBG_CACHED has_windbg_cached.cpp "${CMAKE_CURRENT_SOURCE_DIR}/../config/include" "dbgeng;ole32") + + set(_default_from_exception ON) +-if (CMAKE_CXX_PLATFORM_ID MATCHES "Cygwin") ++if(CMAKE_CXX_PLATFORM_ID MATCHES "Cygwin") + set(_default_from_exception OFF) + endif() + +@@ -139,7 +139,7 @@ + if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 20) + endif() +- if ((CMAKE_CXX_STANDARD IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) AND CMAKE_CXX_MODULE_STD) ++ if((CMAKE_CXX_STANDARD IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) AND CMAKE_CXX_MODULE_STD) + message(STATUS "Using `import std;`") + set(__import_std ON) + else() +@@ -163,12 +163,12 @@ + # boost_stacktrace, default library + + if(BOOST_USE_MODULES) +- add_library(boost_stacktrace) ++ add_library(boost_stacktrace STATIC) + stacktrace_add_module(boost_stacktrace ${__import_std}) + set(__scope PUBLIC) + + foreach(backend noop backtrace addr2line basic windbg windbg_cached) +- if (TARGET boost_stacktrace_${backend}) ++ if(TARGET boost_stacktrace_${backend}) + target_compile_definitions(boost_stacktrace_${backend} INTERFACE BOOST_STACKTRACE_BACKEND_MODULE=${backend}) + endif() + endforeach() +--- libs/stacktrace/test/test.cpp.old 2026-08-12 14:04:00.047147800 +0200 ++++ libs/stacktrace/test/test.cpp 2026-08-24 21:11:15.000000000 +0200 +@@ -85,7 +85,7 @@ + + BOOST_TEST(ss1.str().find(" 1# ") != std::string::npos); + BOOST_TEST(ss2.str().find(" 1# ") != std::string::npos); +- ++ + BOOST_TEST(ss1.str().find(" in ") != std::string::npos); + BOOST_TEST(ss2.str().find(" in ") != std::string::npos); + +@@ -212,7 +212,7 @@ + BOOST_TEST(fv); + if (i > 1 && i < min_size - 3) { // Begin ...and end of the trace may match, skipping + BOOST_TEST(st[i] != fv); +- ++ + #if !(defined(BOOST_STACKTRACE_TEST_NO_DEBUG_AT_ALL) && defined(BOOST_MSVC)) + // MSVC can not get function name withhout debug symbols even if it is exported + BOOST_TEST(st[i].name() != fv.name()); +@@ -276,7 +276,7 @@ + return static_cast(file_size); + } + +-uintptr_t get_address_from_frame(const std::string& frame) { ++std::uintptr_t get_address_from_frame(const std::string& frame) { + std::size_t address = 0; + std::string hex_address; + std::size_t pos = frame.find("0x"); +@@ -284,7 +284,7 @@ + if (pos != std::string::npos) { + // Extract the hex address substring + hex_address = frame.substr(pos + 2); // Skip "0x" +- ++ + // Convert hex string to std::size_t + std::stringstream ss; + ss << std::hex << hex_address; +@@ -295,7 +295,7 @@ + } + + void test_relative_virtual_address(const char* file_path) +-{ ++{ + const auto frame = to_string(boost::stacktrace::stacktrace(0, 1).as_vector().front()); + + // Skip the test if the frame does not contain an address +--- libs/stacktrace/include/boost/stacktrace/detail/libbacktrace_impls.hpp.old 2026-08-12 14:04:00.037349600 +0200 ++++ libs/stacktrace/include/boost/stacktrace/detail/libbacktrace_impls.hpp 2026-08-24 21:06:16.000000000 +0200 +@@ -35,7 +35,7 @@ + std::size_t line; + }; + +-inline void libbacktrace_syminfo_callback(void *data, uintptr_t /*pc*/, const char *symname, uintptr_t /*symval*/, uintptr_t /*symsize*/) { ++inline void libbacktrace_syminfo_callback(void *data, std::uintptr_t /*pc*/, const char *symname, std::uintptr_t /*symval*/, std::uintptr_t /*symsize*/) { + pc_data& d = *static_cast(data); + if (d.function && symname) { + *d.function = symname; +@@ -43,11 +43,11 @@ + } + + // Old versions of libbacktrace have different signature for the callback +-inline void libbacktrace_syminfo_callback(void *data, uintptr_t pc, const char *symname, uintptr_t symval) { ++inline void libbacktrace_syminfo_callback(void *data, std::uintptr_t pc, const char *symname, std::uintptr_t symval) { + boost::stacktrace::detail::libbacktrace_syminfo_callback(data, pc, symname, symval, 0); + } + +-inline int libbacktrace_full_callback(void *data, uintptr_t /*pc*/, const char *filename, int lineno, const char *function) { ++inline int libbacktrace_full_callback(void *data, std::uintptr_t /*pc*/, const char *filename, int lineno, const char *function) { + pc_data& d = *static_cast(data); + if (d.filename && filename) { + *d.filename = filename; +@@ -129,15 +129,15 @@ + if (state) { + ::backtrace_pcinfo( + state, +- reinterpret_cast(addr), ++ reinterpret_cast(addr), + boost::stacktrace::detail::libbacktrace_full_callback, + boost::stacktrace::detail::libbacktrace_error_callback, + &data +- ) ++ ) + || + ::backtrace_syminfo( + state, +- reinterpret_cast(addr), ++ reinterpret_cast(addr), + boost::stacktrace::detail::libbacktrace_syminfo_callback, + boost::stacktrace::detail::libbacktrace_error_callback, + &data +@@ -176,7 +176,7 @@ + if (state) { + ::backtrace_pcinfo( + state, +- reinterpret_cast(addr), ++ reinterpret_cast(addr), + boost::stacktrace::detail::libbacktrace_full_callback, + boost::stacktrace::detail::libbacktrace_error_callback, + &data +@@ -184,7 +184,7 @@ + || + ::backtrace_syminfo( + state, +- reinterpret_cast(addr), ++ reinterpret_cast(addr), + boost::stacktrace::detail::libbacktrace_syminfo_callback, + boost::stacktrace::detail::libbacktrace_error_callback, + &data +@@ -213,7 +213,7 @@ + if (state) { + ::backtrace_pcinfo( + state, +- reinterpret_cast(addr_), ++ reinterpret_cast(addr_), + boost::stacktrace::detail::libbacktrace_full_callback, + boost::stacktrace::detail::libbacktrace_error_callback, + &data +@@ -235,7 +235,7 @@ + if (state) { + ::backtrace_pcinfo( + state, +- reinterpret_cast(addr_), ++ reinterpret_cast(addr_), + boost::stacktrace::detail::libbacktrace_full_callback, + boost::stacktrace::detail::libbacktrace_error_callback, + &data +--- libs/stacktrace/include/boost/stacktrace/detail/addr_base.hpp.old 2026-08-20 10:23:42.511592557 +0200 ++++ libs/stacktrace/include/boost/stacktrace/detail/addr_base.hpp 2026-08-20 10:55:20.396558358 +0200 +@@ -15,25 +15,26 @@ + #if !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE) + #include + #include +-#include +-#include ++#include // std::uintptr_t ++#include ++#include + #endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE) + + namespace boost { namespace stacktrace { namespace detail { + + struct mapping_entry_t { +- uintptr_t start = 0; +- uintptr_t end = 0; +- uintptr_t offset_from_base = 0; ++ std::uintptr_t start = 0; ++ std::uintptr_t end = 0; ++ std::uintptr_t offset_from_base = 0; + + inline bool contains_addr(const void* addr) const { +- uintptr_t addr_uint = reinterpret_cast(addr); ++ std::uintptr_t addr_uint = reinterpret_cast(addr); + return addr_uint >= start && addr_uint < end; + } + }; + +-inline uintptr_t hex_str_to_int(const std::string& str) { +- uintptr_t out; ++inline std::uintptr_t hex_str_to_int(const std::string& str) { ++ std::uintptr_t out; + std::stringstream ss; + ss << std::hex << str; + ss >> out; +@@ -70,12 +71,12 @@ + mapping.end = hex_str_to_int(mapping_end_str); + mapping.offset_from_base = hex_str_to_int(offset_from_base_str); + return mapping; +- } catch(std::invalid_argument& e) { ++ } catch(const std::invalid_argument& e) { + return mapping_entry_t{}; + } + } + +-inline uintptr_t get_own_proc_addr_base(const void* addr) { ++inline std::uintptr_t get_own_proc_addr_base(const void* addr) { + std::ifstream maps_file("/proc/self/maps"); + for (std::string line; std::getline(maps_file, line); ) { + const mapping_entry_t mapping = parse_proc_maps_line(line); +--- libs/stacktrace/include/boost/stacktrace/detail/frame_unwind.ipp.old 2026-08-12 14:04:00.035337900 +0200 ++++ libs/stacktrace/include/boost/stacktrace/detail/frame_unwind.ipp 2026-08-20 10:21:50.242597642 +0200 +@@ -50,7 +50,7 @@ + Base::res = to_hex_array(addr).data(); + #else + const auto addr_base = boost::stacktrace::detail::get_own_proc_addr_base(addr); +- Base::res = to_hex_array(reinterpret_cast(addr) - addr_base).data(); ++ Base::res = to_hex_array(reinterpret_cast(addr) - addr_base).data(); + #endif + } + +--- libs/stacktrace/include/boost/stacktrace/detail/addr2line_impls.hpp.old 2026-08-19 11:39:49.341239746 +0200 ++++ libs/stacktrace/include/boost/stacktrace/detail/addr2line_impls.hpp 2026-08-20 10:21:50.194082770 +0200 +@@ -164,11 +164,11 @@ + } + + inline std::string source_location(const void* addr, bool position_independent) { +- uintptr_t addr_base = 0; ++ std::uintptr_t addr_base = 0; + if (position_independent) { + addr_base = boost::stacktrace::detail::get_own_proc_addr_base(addr); + } +- const void* offset = reinterpret_cast(reinterpret_cast(addr) - addr_base); ++ const void* offset = reinterpret_cast(reinterpret_cast(addr) - addr_base); + std::string source_line = boost::stacktrace::detail::addr2line("-Cpe", reinterpret_cast(offset)); + if (source_line.empty() || source_line[0] == '?') { + return ""; +@@ -211,11 +211,11 @@ + typedef to_string_impl_base to_string_impl; + + inline std::string name(const void* addr, bool position_independent) { +- uintptr_t addr_base = 0; ++ std::uintptr_t addr_base = 0; + if(position_independent){ + addr_base = boost::stacktrace::detail::get_own_proc_addr_base(addr); + } +- const void* offset = reinterpret_cast(reinterpret_cast(addr) - addr_base); ++ const void* offset = reinterpret_cast(reinterpret_cast(addr) - addr_base); + std::string res = boost::stacktrace::detail::addr2line("-fe", offset); + res = res.substr(0, res.find_last_of('\n')); + res = boost::core::demangle(res.c_str()); +@@ -238,11 +238,11 @@ + + inline std::string source_file(const void* addr, bool position_independent) { + std::string res; +- uintptr_t addr_base = 0; ++ std::uintptr_t addr_base = 0; + if(position_independent){ + addr_base = boost::stacktrace::detail::get_own_proc_addr_base(addr); + } +- const void* offset = reinterpret_cast(reinterpret_cast(addr) - addr_base); ++ const void* offset = reinterpret_cast(reinterpret_cast(addr) - addr_base); + res = boost::stacktrace::detail::addr2line("-e", offset); + res = res.substr(0, res.find_last_of(':')); + if (res == "??") { +@@ -254,11 +254,11 @@ + + inline std::size_t source_line(const void* addr, bool position_independent) { + std::size_t line_num = 0; +- uintptr_t addr_base = 0; ++ std::uintptr_t addr_base = 0; + if(position_independent){ + addr_base = boost::stacktrace::detail::get_own_proc_addr_base(addr); + } +- const void* offset = reinterpret_cast(reinterpret_cast(addr) - addr_base); ++ const void* offset = reinterpret_cast(reinterpret_cast(addr) - addr_base); + std::string res = boost::stacktrace::detail::addr2line("-e", offset); + const std::size_t last = res.find_last_of(':'); + if (last == std::string::npos) { +--- libs/stacktrace/include/boost/stacktrace/detail/frame_msvc.ipp.old 2026-08-12 14:04:00.035337900 +0200 ++++ libs/stacktrace/include/boost/stacktrace/detail/frame_msvc.ipp 2026-08-24 21:06:58.000000000 +0200 +@@ -262,7 +262,7 @@ + nullptr, + &base + )); +- ++ + if (res) { + name[0] = '\0'; + size = 0; +@@ -303,7 +303,7 @@ + } + else if (res && size > 1) { + module_name->assign(name, size - 1); +- } ++ } + } + } + +@@ -402,8 +402,8 @@ + res += to_hex_array(addr).data(); + #else + // Get own base address +- const uintptr_t base_addr = get_own_proc_addr_base(addr); +- res += to_hex_array(reinterpret_cast(addr) - base_addr).data(); ++ const std::uintptr_t base_addr = get_own_proc_addr_base(addr); ++ res += to_hex_array(reinterpret_cast(addr) - base_addr).data(); + #endif + } + +--- libs/stacktrace/modules/boost_stacktrace_dump.cppm.old 2026-08-19 18:02:37.092932000 +0200 ++++ libs/stacktrace/modules/boost_stacktrace_dump.cppm 2026-08-20 10:53:52.185787423 +0200 +@@ -15,13 +15,17 @@ + #include + + #if !defined(BOOST_STACKTRACE_USE_STD_MODULE) +-#include ++#include ++#include // std::uintptr_t + #endif + + #include +-#include + #include + ++#if !defined(BOOST_WINDOWS) ++# include ++#endif ++ + #define BOOST_STACKTRACE_INTERFACE_UNIT + #define BOOST_STACKTRACE_LINK + diff --git a/patches/1.92.0/cmake-cxx_modules.patch b/patches/1.92.0/cmake-cxx_modules.patch new file mode 100644 index 00000000..0610e969 --- /dev/null +++ b/patches/1.92.0/cmake-cxx_modules.patch @@ -0,0 +1,412 @@ +--- tools/cmake/include/BoostInstall.cmake.old 2026-08-20 18:18:48.000000000 +0200 ++++ tools/cmake/include/BoostInstall.cmake 2026-08-25 10:30:11.000000000 +0200 +@@ -3,7 +3,7 @@ + # Distributed under the Boost Software License, Version 1.0. + # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt + +-if(NOT CMAKE_VERSION VERSION_LESS 3.10) ++if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.10) + include_guard() + endif() + +@@ -337,6 +337,27 @@ + string(APPEND CONFIG_INSTALL_DIR "-static") + endif() + ++ set(__INSTALL_CXX_MODULES) ++ set(__EXPORT_CXX_MODULES_CONFIG_FILES) ++ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.28) ++ get_target_property(INTERFACE_CXX_MODULE_SETS ${LIB} INTERFACE_CXX_MODULE_SETS) ++ if(INTERFACE_CXX_MODULE_SETS) ++ boost_message(DEBUG "boost_install_target: '${__TARGET}' has INTERFACE_CXX_MODULE_SETS=${INTERFACE_CXX_MODULE_SETS}") ++ set(extrainstalldir "${CMAKE_INSTALL_DATADIR}/boost-${__VERSION}/${LIB}") ++ set(__INSTALL_CXX_MODULES FILE_SET ${INTERFACE_CXX_MODULE_SETS} DESTINATION ${extrainstalldir}) ++ set(__EXPORT_CXX_MODULES_CONFIG_FILES CXX_MODULES_DIRECTORY .) ++ endif() ++ endif() ++ ++ set(__INSTALL_HEADER_SETS) ++ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.23) ++ get_target_property(INTERFACE_HEADER_SETS ${LIB} INTERFACE_HEADER_SETS) ++ if(INTERFACE_HEADER_SETS) ++ boost_message(DEBUG "boost_install_target: '${__TARGET}' has INTERFACE_HEADER_SETS=${INTERFACE_HEADER_SETS}") ++ set(__INSTALL_HEADER_SETS FILE_SET ${INTERFACE_HEADER_SETS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/boost-${__VERSION}") ++ endif() ++ endif() ++ + install(TARGETS ${LIB} EXPORT ${LIB}-targets + # explicit destination specification required for 3.13, 3.14 no longer needs it + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" +@@ -344,8 +365,17 @@ + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + PRIVATE_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ++ # NOTE: explicit needed if used starting with cmake v3.28! ++ # optional install: FILE_SET CXX_MODULES DESTINATION "${CMAKE_INSTALL_DATADIR}" ++ ${__INSTALL_CXX_MODULES} ++ # NOTE: explicit needed if used starting with cmake v3.23! ++ # Any module files from C++ modules from PUBLIC sources in a file set ++ # of type CXX_MODULES will be installed to the given DESTINATION. ++ # optional install: FILE_SET HEADERS ++ ${__INSTALL_HEADER_SETS} + ) + ++ # TODO(CK): what is this for? + export(TARGETS ${LIB} NAMESPACE Boost:: FILE export/${LIB}-targets.cmake) + + if(MSVC) +@@ -353,7 +383,7 @@ + install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) + endif() + +- if(TYPE STREQUAL "STATIC_LIBRARY" AND NOT CMAKE_VERSION VERSION_LESS 3.15) ++ if(TYPE STREQUAL "STATIC_LIBRARY" AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.15) + install(FILES "$/$$.pdb" DESTINATION ${CMAKE_INSTALL_LIBDIR} OPTIONAL) + endif() + endif() +@@ -362,7 +392,11 @@ + __boost_install_update_sources(${LIB} ${__EXTRA_DIRECTORY} ${__EXTRA_INSTALL_DIRECTORY}) + endif() + +- install(EXPORT ${LIB}-targets DESTINATION "${CONFIG_INSTALL_DIR}" NAMESPACE Boost:: FILE ${LIB}-targets.cmake) ++ install(EXPORT ${LIB}-targets DESTINATION "${CONFIG_INSTALL_DIR}" NAMESPACE Boost:: FILE ${LIB}-targets.cmake ++ # NOTE: explicit needed if used starting with cmake v3.28! ++ # optional install config packages for: FILE_SET CXX_MODULES ++ ${__EXPORT_CXX_MODULES_CONFIG_FILES} ++ ) + + set_target_properties(${LIB} PROPERTIES _boost_is_installed ON) + +@@ -491,7 +525,7 @@ + + # Header-only libraries are architecture-independent + +- if(NOT CMAKE_VERSION VERSION_LESS 3.14) ++ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.14) + + write_basic_package_version_file("${CONFIG_VERSION_FILE_NAME}" COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT) + +@@ -589,6 +623,7 @@ + + endif() + ++ set(extrainstalldir) + if(__EXTRA_DIRECTORY AND NOT BOOST_SKIP_INSTALL_RULES AND NOT CMAKE_SKIP_INSTALL_RULES) + + # Extract the library name from the path, one component up from the extra directory +--- tools/cmake/include/BoostRoot.cmake.old 2026-08-20 18:44:31.506539647 +0200 ++++ tools/cmake/include/BoostRoot.cmake 2026-08-17 16:46:20.302542033 +0200 +@@ -123,7 +123,9 @@ + set(BOOST_SKIP_INSTALL_RULES ON) + endif() + +- set(BUILD_TESTING OFF) ++ if(NOT BOOST_BUILD_TESTING) ++ set(BUILD_TESTING OFF) ++ endif() + + endif() + +@@ -303,6 +305,9 @@ + + endmacro() + ++# C++20 modules ++option(BOOST_USE_MODULES "Build Boost as a collection of C++20 modules (unstable)" OFF) ++ + # + + file(GLOB __boost_libraries RELATIVE "${BOOST_SUPERPROJECT_SOURCE_DIR}/libs" "${BOOST_SUPERPROJECT_SOURCE_DIR}/libs/*/CMakeLists.txt" "${BOOST_SUPERPROJECT_SOURCE_DIR}/libs/numeric/*/CMakeLists.txt") +--- libs/serialization/CMakeLists.txt.old 2026-08-19 11:08:14.000000000 +0200 ++++ libs/serialization/CMakeLists.txt 2026-08-17 16:46:20.302748163 +0200 +@@ -6,6 +6,8 @@ + + project(boost_serialization VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) + ++set(CMAKE_UNITY_BUILD OFF) ++ + add_library(boost_serialization + src/archive_exception.cpp + src/basic_archive.cpp +--- libs/any/CMakeLists.txt.old 2026-08-18 19:27:38.000000000 +0200 ++++ libs/any/CMakeLists.txt 2026-08-21 13:15:12.036761186 +0200 +@@ -2,25 +2,25 @@ + # Distributed under the Boost Software License, Version 1.0. + # See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt + +-cmake_minimum_required( VERSION 3.8...3.31 ) ++cmake_minimum_required(VERSION 3.8...4.4) + project( boost_any VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX ) + +-if (BOOST_USE_MODULES) +- add_library(boost_any) ++if(BOOST_USE_MODULES) ++ add_library(boost_any STATIC) + target_sources(boost_any PUBLIC +- FILE_SET modules_public +- TYPE CXX_MODULES ++ FILE_SET CXX_MODULES ++ BASE_DIRS modules + FILES modules/boost_any.cppm + ) + + target_compile_features(boost_any PUBLIC cxx_std_20) + target_compile_definitions(boost_any PUBLIC BOOST_USE_MODULES) +- set(__boost_cxx_standard ${CMAKE_CXX_STANDARD}) +- if (NOT __boost_cxx_standard) +- set(__boost_cxx_standard 20) ++ if(NOT CMAKE_CXX_STANDARD) ++ set(CMAKE_CXX_STANDARD 20) + endif() +- if (CMAKE_CXX_COMPILER_IMPORT_STD AND ${__boost_cxx_standard} IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) +- target_compile_definitions(boost_any PRIVATE BOOST_ANY_USE_STD_MODULE) ++ if(CMAKE_CXX_MODULE_STD AND CMAKE_CXX_STANDARD IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) ++ target_compile_definitions(boost_any PUBLIC BOOST_ANY_USE_STD_MODULE) ++ target_compile_features(boost_any PUBLIC cxx_std_23) + message(STATUS "Using `import std;`") + else() + message(STATUS "`import std;` is not available") +--- libs/any/test/cmake_subdir_test/CMakeLists.txt.old 2026-08-25 19:10:14.976204000 +0200 ++++ libs/any/test/cmake_subdir_test/CMakeLists.txt 2026-08-25 21:02:47.414261244 +0200 +@@ -2,28 +2,31 @@ + # Distributed under the Boost Software License, Version 1.0. + # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt + +-cmake_minimum_required(VERSION 3.5...4.0) ++cmake_minimum_required(VERSION 3.5...4.4) + + project(any_subdir_test LANGUAGES CXX) + + add_subdirectory(../../../assert boostorg/assert) +-add_subdirectory(../../../core boostorg/core) + add_subdirectory(../../../config boostorg/config) + add_subdirectory(../../../container_hash boostorg/container_hash) ++add_subdirectory(../../../core boostorg/core) + add_subdirectory(../../../describe boostorg/describe) + add_subdirectory(../../../detail boostorg/detail) + add_subdirectory(../../../integer boostorg/integer) + add_subdirectory(../../../mp11 boostorg/mp11) ++add_subdirectory(../../../predef boostorg/predef) + add_subdirectory(../../../preprocessor boostorg/preprocessor) ++add_subdirectory(../../../smart_ptr boostorg/smart_ptr) + add_subdirectory(../../../throw_exception boostorg/throw_exception) + add_subdirectory(../../../type_index boostorg/type_index) + add_subdirectory(../../../type_traits boostorg/type_traits) ++add_subdirectory(../../../unordered boostorg/unordered) + + add_subdirectory(../../ boostorg/any) + + enable_testing() + +-if (BOOST_USE_MODULES) ++if(BOOST_USE_MODULES) + add_executable(boost_any_module_usage ../../modules/usage_sample.cpp) + target_link_libraries(boost_any_module_usage PRIVATE Boost::any) + add_test(NAME boost_any_module_usage COMMAND boost_any_module_usage) +@@ -46,7 +49,7 @@ + # any_test.cpp # Ambiguous with modules, because all the anys now available + ) + +-foreach (testsourcefile ${RUN_TESTS_SOURCES}) ++foreach(testsourcefile ${RUN_TESTS_SOURCES}) + get_filename_component(testname ${testsourcefile} NAME_WLE) + add_executable(${PROJECT_NAME}_${testname} ../${testsourcefile}) + target_link_libraries(${PROJECT_NAME}_${testname} Boost::any Boost::core) +--- libs/conversion/CMakeLists.txt.old 2026-08-18 18:13:14.105023000 +0200 ++++ libs/conversion/CMakeLists.txt 2026-08-21 13:09:29.125413790 +0200 +@@ -4,23 +4,23 @@ + # Distributed under the Boost Software License, Version 1.0. + # See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt + +-cmake_minimum_required(VERSION 3.5...4.20) ++cmake_minimum_required(VERSION 3.5...4.4) ++ + project(boost_conversion VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) + +-if (BOOST_USE_MODULES) +- add_library(boost_conversion) ++if(BOOST_USE_MODULES) ++ add_library(boost_conversion STATIC) + target_sources(boost_conversion PUBLIC +- FILE_SET modules_public +- TYPE CXX_MODULES +- BASE_DIRS modules +- FILES ${CMAKE_CURRENT_LIST_DIR}/modules/boost_conversion.cppm ++ FILE_SET CXX_MODULES ++ BASE_DIRS modules ++ FILES modules/boost_conversion.cppm + ) + + target_compile_definitions(boost_conversion PUBLIC BOOST_USE_MODULES) + get_property(__standard TARGET boost_conversion PROPERTY CXX_STANDARD) +- if (__standard IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD AND CMAKE_CXX_MODULE_STD) ++ if(__standard IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD AND CMAKE_CXX_MODULE_STD) + target_compile_features(boost_conversion PUBLIC cxx_std_23) +- target_compile_definitions(boost_conversion PRIVATE BOOST_CONVERSION_USE_STD_MODULE) ++ target_compile_definitions(boost_conversion PUBLIC BOOST_CONVERSION_USE_STD_MODULE) + message(STATUS "Using `import std;`") + else() + target_compile_features(boost_conversion PUBLIC cxx_std_20) +--- libs/dll/CMakeLists.txt.old 2026-08-18 17:46:16.508869000 +0200 ++++ libs/dll/CMakeLists.txt 2026-08-18 17:33:54.245209309 +0200 +@@ -5,7 +5,7 @@ + # Distributed under the Boost Software License, Version 1.0. + # https://www.boost.org/LICENSE_1_0.txt + +-cmake_minimum_required(VERSION 3.5...4.20) ++cmake_minimum_required(VERSION 3.5...4.4) + + project(boost_dll VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) + +@@ -51,14 +51,14 @@ + + # Default library + +-if (BOOST_USE_MODULES) ++if(BOOST_USE_MODULES) + add_library(boost_dll) + target_compile_definitions(boost_dll PUBLIC BOOST_USE_MODULES) + + get_property(__standard TARGET boost_dll PROPERTY CXX_STANDARD) +- if (__standard IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD AND CMAKE_CXX_MODULE_STD) ++ if(__standard IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD AND CMAKE_CXX_MODULE_STD) + target_compile_features(boost_dll PUBLIC cxx_std_23) +- target_compile_definitions(boost_dll PRIVATE BOOST_DLL_USE_STD_MODULE) ++ target_compile_definitions(boost_dll PUBLIC BOOST_DLL_USE_STD_MODULE) + message(STATUS "Using `import std;`") + else() + target_compile_features(boost_dll PUBLIC cxx_std_20) +@@ -80,7 +80,7 @@ + + add_library(Boost::dll ALIAS boost_dll) + target_include_directories(boost_dll ${__scope} include) +-if (BOOST_DLL_USE_STD_FS) ++if(BOOST_DLL_USE_STD_FS) + target_link_libraries(boost_dll ${__scope} Boost::dll_std_fs) + else() + target_link_libraries(boost_dll ${__scope} Boost::dll_boost_fs) +--- libs/lexical_cast/CMakeLists.txt.old 2026-08-17 21:14:44.138016000 +0200 ++++ libs/lexical_cast/CMakeLists.txt 2026-08-21 13:09:18.668146913 +0200 +@@ -3,22 +3,26 @@ + # Distributed under the Boost Software License, Version 1.0. + # https://www.boost.org/LICENSE_1_0.txt + +-cmake_minimum_required(VERSION 3.5...4.0) ++cmake_minimum_required(VERSION 3.5...4.4) + + project(boost_lexical_cast VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) + +- +-if (BOOST_USE_MODULES) +- add_library(boost_lexical_cast) ++if(BOOST_USE_MODULES) ++ add_library(boost_lexical_cast STATIC) + target_sources(boost_lexical_cast PUBLIC +- FILE_SET modules_public TYPE CXX_MODULES FILES +- ${CMAKE_CURRENT_LIST_DIR}/modules/boost_lexical_cast.cppm ++ FILE_SET CXX_MODULES ++ BASE_DIRS modules ++ FILES modules/boost_lexical_cast.cppm + ) + + target_compile_features(boost_lexical_cast PUBLIC cxx_std_20) + target_compile_definitions(boost_lexical_cast PUBLIC BOOST_USE_MODULES) +- if (CMAKE_CXX_COMPILER_IMPORT_STD) +- target_compile_definitions(boost_lexical_cast PRIVATE BOOST_LEXICAL_CAST_USE_STD_MODULE) ++ if(NOT CMAKE_CXX_STANDARD) ++ set(CMAKE_CXX_STANDARD 20) ++ endif() ++ if (CMAKE_CXX_MODULE_STD AND CMAKE_CXX_STANDARD IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) ++ target_compile_definitions(boost_lexical_cast PUBLIC BOOST_LEXICAL_CAST_USE_STD_MODULE) ++ target_compile_features(boost_lexical_cast PUBLIC cxx_std_23) + message(STATUS "Using `import std;`") + else() + message(STATUS "`import std;` is not available") +--- libs/pfr/CMakeLists.txt.old 2026-08-18 19:29:18.000000000 +0200 ++++ libs/pfr/CMakeLists.txt 2026-08-21 13:10:00.727689106 +0200 +@@ -4,20 +4,26 @@ + # Distributed under the Boost Software License, Version 1.0. + # https://www.boost.org/LICENSE_1_0.txt + +-cmake_minimum_required(VERSION 3.5...3.31) ++cmake_minimum_required(VERSION 3.28...4.4) + + project(boost_pfr VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) + +-if (BOOST_USE_MODULES) +- add_library(boost_pfr) ++if(BOOST_USE_MODULES) ++ add_library(boost_pfr STATIC) + target_sources(boost_pfr PUBLIC +- FILE_SET modules_public TYPE CXX_MODULES FILES modules/boost_pfr.cppm ++ FILE_SET CXX_MODULES ++ BASE_DIRS modules ++ FILES modules/boost_pfr.cppm + ) + + target_compile_features(boost_pfr PUBLIC cxx_std_20) + target_compile_definitions(boost_pfr PUBLIC BOOST_USE_MODULES) +- if (CMAKE_CXX_COMPILER_IMPORT_STD) +- target_compile_definitions(boost_pfr PRIVATE BOOST_PFR_USE_STD_MODULE) ++ if(NOT CMAKE_CXX_STANDARD) ++ set(CMAKE_CXX_STANDARD 20) ++ endif() ++ if(CMAKE_CXX_MODULE_STD AND CMAKE_CXX_STANDARD IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) ++ target_compile_definitions(boost_pfr PUBLIC BOOST_PFR_USE_STD_MODULE) ++ target_compile_features(boost_pfr PUBLIC cxx_std_23) + message(STATUS "Using `import std;`") + else() + message(STATUS "`import std;` is not available") +@@ -31,11 +37,11 @@ + add_library(Boost::pfr ALIAS boost_pfr) + + enable_testing() +-if (BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") ++if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") + add_subdirectory(test) + endif() + +-if (BOOST_USE_MODULES AND BUILD_TESTING) ++if(BOOST_USE_MODULES AND BUILD_TESTING) + add_executable(boost_pfr_module_usage modules/usage_sample.cpp) + target_link_libraries(boost_pfr_module_usage PRIVATE Boost::pfr) + add_test(NAME boost_pfr_module_usage COMMAND boost_pfr_module_usage) +--- libs/type_index/CMakeLists.txt.old 2026-08-17 21:36:16.377197000 +0200 ++++ libs/type_index/CMakeLists.txt 2026-08-21 13:10:17.933107868 +0200 +@@ -4,24 +4,26 @@ + # Distributed under the Boost Software License, Version 1.0. + # https://www.boost.org/LICENSE_1_0.txt + +-cmake_minimum_required(VERSION 3.5...4.20) ++cmake_minimum_required(VERSION 3.5...4.4) + + project(boost_type_index VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) + +-if (BOOST_USE_MODULES) +- add_library(boost_type_index) +- target_sources(boost_type_index +- PUBLIC ++if(BOOST_USE_MODULES) ++ add_library(boost_type_index STATIC) ++ target_sources(boost_type_index PUBLIC + FILE_SET CXX_MODULES +- BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" +- FILES "${CMAKE_CURRENT_SOURCE_DIR}/modules/boost_type_index.cppm" ++ BASE_DIRS modules ++ FILES "modules/boost_type_index.cppm" + ) + + target_compile_features(boost_type_index PUBLIC cxx_std_20) + target_compile_definitions(boost_type_index PUBLIC BOOST_USE_MODULES) +- if ((CMAKE_CXX_STANDARD IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) AND CMAKE_CXX_MODULE_STD) +- target_compile_features(boost_type_index PRIVATE cxx_std_23) +- target_compile_definitions(boost_type_index PRIVATE BOOST_TYPE_INDEX_USE_STD_MODULE) ++ if(NOT CMAKE_CXX_STANDARD) ++ set(CMAKE_CXX_STANDARD 20) ++ endif() ++ if(CMAKE_CXX_MODULE_STD AND CMAKE_CXX_STANDARD IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) ++ target_compile_features(boost_type_index PUBLIC cxx_std_23) ++ target_compile_definitions(boost_type_index PUBLIC BOOST_TYPE_INDEX_USE_STD_MODULE) + message(STATUS "Using `import std;`") + else() + message(STATUS "`import std;` is not available") diff --git a/patches/1.92.0/update.sh b/patches/1.92.0/update.sh new file mode 100644 index 00000000..24e83582 --- /dev/null +++ b/patches/1.92.0/update.sh @@ -0,0 +1,3 @@ +#! /bin/sh + +cat cmake-cxx_modules.patch boost-*.patch > TheBigBoost.patch diff --git a/requirements.txt b/requirements.txt index 7c02bba1..e39fda21 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # ============================================================================= # PYTHON PACKAGES (PIP) # ============================================================================= -# USE (python3): pip3 install -U -r requirements.txt +# USE (python3): uv pip install -r requirements.txt # ============================================================================= ### python tools @@ -17,9 +17,9 @@ pre-commit ### cmake build context bump2version>=1.0.1 check-jsonschema>=0.31.2 -cmake>=3.30 +cmake>=4.4 codespell>=2.4.2 -conan>=2.28.1 +# conan>=2.31.2 gcovr>=8.6 ninja>=1.13 yamllint>=1.35 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 00000000..b81cf2e6 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,36 @@ +cmake_minimum_required(VERSION 3.28...4.4) + +project(gcc_typeinfo_module_reproducer LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 23) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_SCAN_FOR_MODULES ON) + +################################################## +include(FetchContent) +FetchContent_Declare( + boost-cmake + URL https://github.com/ClausKlein/boost-cmake/archive/refs/tags/v1.92.0-rc3.tar.gz + URL_HASH SHA256=bbcd4de95670755b39f874ae7efe307beef19c6b53c9736c037ebd794e10bab0 + PATCH_COMMAND patch --backup --forward -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/readme.patch + # XXX NO! EXCLUDE_FROM_ALL + SYSTEM + SOURCE_SUBDIR tests +) +FetchContent_MakeAvailable(boost-cmake) + +return() # NOTE: XXX used here! CK +################################################## + +add_library(typeinfo_module) + +target_sources(typeinfo_module PUBLIC FILE_SET CXX_MODULES FILES m.cppm) + +add_executable(typeinfo_module_test main.cpp) + +target_link_libraries(typeinfo_module_test PRIVATE typeinfo_module) + +enable_testing() + +add_test(NAME typeinfo_module_test COMMAND typeinfo_module_test) diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 00000000..35754fb5 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,44 @@ +## Minimal reproducible example for this build problem of `boost::lexical_cast`: + +Same result on Linux with gcc (GCC) 16.1.1 20260713 and, OSX with (Homebrew GCC 16.1.0) + +### usage: + +```bash +cmake -S . -B build -G Ninja \ + -D CMAKE_CXX_COMPILER=g++-16 \ + -D CMAKE_CXX_COMPILER_LAUNCHER= + +cmake --build build --verbose +``` + +```bash +root@23cd2d07fb08:/src# cmake --build --preset Release +[0/2] Re-checking globbed directories... +[7/20] Building CXX object examples/CMakeFiles/ExampleLexical_cast.dir/lexical_cast_usage_sample.cpp.o +FAILED: [code=1] examples/CMakeFiles/ExampleLexical_cast.dir/lexical_cast_usage_sample.cpp.o +/usr/bin/ccache /usr/bin/g++ -DBOOST_CONTAINER_NO_LIB -DBOOST_USE_MODULES -isystem /src/build/Release/_deps/boost-src/libs/lexical_cast/include -isystem /src/build/Release/_deps/boost-src/libs/config/include -isystem /src/build/Release/_deps/boost-src/libs/container/include -isystem /src/build/Release/_deps/boost-src/libs/assert/include -isystem /src/build/Release/_deps/boost-src/libs/intrusive/include -isystem /src/build/Release/_deps/boost-src/libs/move/include -isystem /src/build/Release/_deps/boost-src/libs/core/include -isystem /src/build/Release/_deps/boost-src/libs/throw_exception/include -O3 -DNDEBUG -std=c++23 -MD -MT examples/CMakeFiles/ExampleLexical_cast.dir/lexical_cast_usage_sample.cpp.o -MF examples/CMakeFiles/ExampleLexical_cast.dir/lexical_cast_usage_sample.cpp.o.d -fmodules-ts -fmodule-mapper=examples/CMakeFiles/ExampleLexical_cast.dir/lexical_cast_usage_sample.cpp.o.modmap -MD -fdeps-format=p1689r5 -x c++ -o examples/CMakeFiles/ExampleLexical_cast.dir/lexical_cast_usage_sample.cpp.o -c /src/examples/lexical_cast_usage_sample.cpp +In file included from /src/build/Release/_deps/boost-src/libs/lexical_cast/include/boost/lexical_cast.hpp:38, + from /src/build/Release/_deps/boost-src/libs/lexical_cast/modules/boost_lexical_cast.cppm:57, +of module boost.lexical_cast, imported at /src/examples/lexical_cast_usage_sample.cpp:12: +/src/build/Release/_deps/boost-src/libs/lexical_cast/include/boost/lexical_cast/bad_lexical_cast.hpp: In instantiation of ‘void boost::conversion::detail::throw_bad_cast@boost.lexical_cast() [with S = char [2]; T = int]’: +/src/build/Release/_deps/boost-src/libs/lexical_cast/include/boost/lexical_cast.hpp:50:70: required from ‘Target boost::lexical_cast@boost.lexical_cast(const Source&) [with Target = int; Source = char [2]]’ + 50 | boost::conversion::detail::throw_bad_cast(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ +/src/examples/lexical_cast_usage_sample.cpp:16:34: required from here + 16 | return boost::lexical_cast("0"); + | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ +/src/build/Release/_deps/boost-src/libs/lexical_cast/include/boost/lexical_cast/bad_lexical_cast.hpp:96:45: error: must ‘#include ’ before using ‘typeid’ + 39 | // exception used to indicate runtime lexical_cast failure + +++ |+#include + 40 | class BOOST_SYMBOL_VISIBLE bad_lexical_cast : +...... + 96 | const std::type_info& source_type = typeid(S); + | ^~~~~~~~~ +/src/build/Release/_deps/boost-src/libs/lexical_cast/include/boost/lexical_cast/bad_lexical_cast.hpp:97:45: error: must ‘#include ’ before using ‘typeid’ + 97 | const std::type_info& target_type = typeid(T); + | ^~~~~~~~~ +[10/20] Linking CXX executable stage/bin/ExampleAsio +ninja: build stopped: subcommand failed. +root@23cd2d07fb08:/src# +``` diff --git a/tests/m.cppm b/tests/m.cppm new file mode 100644 index 00000000..887902b9 --- /dev/null +++ b/tests/m.cppm @@ -0,0 +1,13 @@ +// m.cppm +module; +#include + +export module m; + +template void detail() { + (void)typeid(T); +} + +export template void function() { + detail(); +} diff --git a/tests/main.cpp b/tests/main.cpp new file mode 100644 index 00000000..00b4a01b --- /dev/null +++ b/tests/main.cpp @@ -0,0 +1,6 @@ +// main.cpp +import m; + +int main() { + function(); +} diff --git a/tests/readme.patch b/tests/readme.patch new file mode 100644 index 00000000..ed46a340 --- /dev/null +++ b/tests/readme.patch @@ -0,0 +1,38 @@ +diff --git a/tests/README.md b/tests/README.md +index 35754fb..23336b3 100644 +--- a/tests/README.md ++++ b/tests/README.md +@@ -10,8 +10,33 @@ cmake -S . -B build -G Ninja \ + -D CMAKE_CXX_COMPILER_LAUNCHER= + + cmake --build build --verbose ++ ++Change Dir: '/Users/clausklein/Workspace/cpp/cxx20/boost-cmake/tests/build' ++ ++Run Build Command(s): /Users/clausklein/.local/bin/ninja -v ++[1/2] /usr/local/bin/g++-16 -std=c++23 -MD -MT CMakeFiles/typeinfo_module_test.dir/main.cpp.o -MF CMakeFiles/typeinfo_module_test.dir/main.cpp.o.d -fmodules-ts -fmodule-mapper=CMakeFiles/typeinfo_module_test.dir/main.cpp.o.modmap -MD -fdeps-format=p1689r5 -x c++ -o CMakeFiles/typeinfo_module_test.dir/main.cpp.o -c /Users/clausklein/Workspace/cpp/cxx20/boost-cmake/tests/main.cpp ++FAILED: [code=1] CMakeFiles/typeinfo_module_test.dir/main.cpp.o ++/usr/local/bin/g++-16 -std=c++23 -MD -MT CMakeFiles/typeinfo_module_test.dir/main.cpp.o -MF CMakeFiles/typeinfo_module_test.dir/main.cpp.o.d -fmodules-ts -fmodule-mapper=CMakeFiles/typeinfo_module_test.dir/main.cpp.o.modmap -MD -fdeps-format=p1689r5 -x c++ -o CMakeFiles/typeinfo_module_test.dir/main.cpp.o -c /Users/clausklein/Workspace/cpp/cxx20/boost-cmake/tests/main.cpp ++In module m, imported at /Users/clausklein/Workspace/cpp/cxx20/boost-cmake/tests/main.cpp:2: ++/Users/clausklein/Workspace/cpp/cxx20/boost-cmake/tests/m.cppm: In instantiation of 'void detail@m() [with T = int]': ++/Users/clausklein/Workspace/cpp/cxx20/boost-cmake/tests/m.cppm:12:12: required from 'void function@m() [with T = int]' ++ 12 | detail(); ++ | ~~~~~~~~~^~ ++/Users/clausklein/Workspace/cpp/cxx20/boost-cmake/tests/main.cpp:5:16: required from here ++ 5 | function(); ++ | ~~~~~~~~~~~~~^~ ++/Users/clausklein/Workspace/cpp/cxx20/boost-cmake/tests/m.cppm:8:9: error: must '#include ' before using 'typeid' ++ 6 | ++ +++ |+#include ++ 7 | template void detail() { ++ 8 | (void)typeid(T); ++ | ^~~~~~~~~ ++ninja: build stopped: subcommand failed. ++ + ``` + ++#### the original problem was ++ + ```bash + root@23cd2d07fb08:/src# cmake --build --preset Release + [0/2] Re-checking globbed directories...