Skip to content

cmake: require CMake 3.16 (fixes #139) - #144

Merged
jll63 merged 3 commits into
boostorg:developfrom
jll63:fix/cmake-pre-3.16
Nov 9, 2026
Merged

jll63 merged 3 commits into
boostorg:developfrom
jll63:fix/cmake-pre-3.16

Conversation

@jll63

@jll63 jll63 commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

(Written by Claude Code, on behalf of @jll63.)

Fixes #139 (#139).

The library declared cmake_minimum_required(VERSION 3.8...3.20), but the tests use target_precompile_headers, which needs CMake 3.16. As a result, configuring the superproject with -DBUILD_TESTING=ON failed on CMake 3.8 through 3.15 (boostorg/cmake run 41556485068).

This PR raises the declared minimum to 3.16 instead of making the tests work on older versions:

  • 3.16 is what was tested. Boost.CI's minimum-CMake job ran 3.16 until Set the minimum CMake version based on the version specified in the CMakeLists.txt boost-ci#355 (2026-11-05) made it read the version from CMakeLists.txt. Since then it tries 3.8, which fails before reaching our code: CMake 4 refuses to build CMake 3.8, because CMake 3.8 declares cmake_minimum_required(VERSION 2.8.12.2).
  • No supported environment needs anything older. CMake 3.8 dates from April 2017 and was never shipped by any Ubuntu release (17.04 had 3.7.2, 17.10 had 3.9.1). Ubuntu 20.04 ships 3.16.3. CI already excludes gcc ≤ 9, and every distribution that ships gcc 10 also ships CMake 3.16 or newer.
  • The boostorg/cmake CI then skips openmethod below 3.16, because its script excludes a library whose declared minimum is above the CMake under test.

The change is two cmake_minimum_required lines (root and test/cmake_test).

The failing Min. CMake job

The Min. CMake, 3.16 job fails, but not because of this change: it fails before configuring anything of ours. Since ubuntu-latest moved to ubuntu-26.04, the runner's CMake 4 cannot build CMake 3.16 from source either, because it rejects the old cmake_minimum_required in 3.16's Source/kwsys/CMakeLists.txt. The same job passed on develop on 2026-11-03, when it still ran on ubuntu-24.04. The CMake cache missed in both runs, so the image is the only thing that changed. Every library using the reusable workflow will hit this until Boost.CI adds -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to its CMake build flags.

Testing

  • CMake 3.16.0 (the version Boost.CI's min-CMake job runs): superproject configure with -DBUILD_TESTING=ON -DBOOST_INCLUDE_LIBRARIES=openmethod, Debug, PCH generated, 142/142 openmethod tests pass.
  • CMake 3.28, standalone build: 215/215 tests pass.
  • CMake 3.15.7: the boostorg/cmake exclusion check reads the declared 3.16 and skips the library.

🤖 Generated with Claude Code

@jll63 jll63 changed the title cmake: tests configure on CMake < 3.16 (fixes #139) cmake: require CMake 3.16 (fixes #139) Nov 7, 2026
@cppalliance-bot

cppalliance-bot commented Nov 7, 2026 •

Copy link
Copy Markdown

An automated preview of the documentation is available at https://144.openmethod.prtest3.cppalliance.org/libs/openmethod/doc/html/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-11-07 17:22:11 UTC

The library declared cmake_minimum_required(VERSION 3.8...), but the
tests use target_precompile_headers, which needs 3.16, so configuring
the superproject with BUILD_TESTING=ON failed on CMake 3.8 to 3.15.

3.16 is the version that was actually tested: Boost.CI's minimum-CMake
job ran 3.16 until it began deriving the version from this file. It is
also what Ubuntu 20.04 ships, and every toolchain the library supports
(gcc 10 or later) comes with it or newer. 3.8 dates from April 2017 and
was never shipped by any Ubuntu release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jll63
jll63 force-pushed the fix/cmake-pre-3.16 branch from aa04f4c to d6f3929 Compare November 7, 2026 13:27
@jll63
jll63 requested a review from pdimov November 7, 2026 13:27
@jll63

jll63 commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

@pdimov I have to wait Nov 12 (Boost 1.93.0 open for bug fixes) to merge into master, correct? And request permission from release managers?

@jll63
jll63 marked this pull request as draft November 7, 2026 13:35
@jll63

jll63 commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Blocked by boostorg/boost-ci#358

@pdimov

pdimov commented Nov 7, 2026

Copy link
Copy Markdown
Member

I have to wait Nov 12 (Boost 1.93.0 open for bug fixes) to merge into master, correct? And request permission from release managers?

Correct.

@pdimov

pdimov commented Nov 7, 2026

Copy link
Copy Markdown
Member

While this is the correct long term solution, I would prefer if we fix that now by checking the CMake version around the target_precompile_headers calls. We will revisit this after the release, when if there are no objections, we'll raise the Boost-wide CMake minimum to 3.16 as discussed on the list.

@codecov

codecov Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.57%. Comparing base (b681217) to head (81db2f3).
⚠️ Report is 24 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #144   +/-   ##
========================================
  Coverage    92.56%   92.57%           
========================================
  Files           29       29           
  Lines         2314     2316    +2     
  Branches       699      699           
========================================
+ Hits          2142     2144    +2     
  Misses         111      111           
  Partials        61       61           

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 456d95c...81db2f3. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

jll63 and others added 2 commits November 7, 2026 10:26
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jll63
jll63 marked this pull request as ready for review November 8, 2026 13:57
@jll63
jll63 merged commit f535533 into boostorg:develop Nov 9, 2026
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configuring with CMake < 3.16 fails

3 participants