Skip to content

add c++ module support (and c++26) - #1823

Open
TheJJ wants to merge 30 commits into
SFTtech:masterfrom
TheJJ:bump-cpp
Open

TheJJ wants to merge 30 commits into
SFTtech:masterfrom
TheJJ:bump-cpp

Conversation

@TheJJ

@TheJJ TheJJ commented Oct 5, 2026

Copy link
Copy Markdown
Member
  • adjust buildsystem to support c++ modules
  • replace makefile with justfile
  • use ninja instead of make (required for dependency scanning + c++ module build order)

fixes #1787

@TheJJ TheJJ added the kevin-rebuild-pl0x instruct kevin to rebuild this pull request label Oct 5, 2026
@SFTbot SFTbot removed the kevin-rebuild-pl0x instruct kevin to rebuild this pull request label Oct 5, 2026
@TheJJ TheJJ added the kevin-rebuild-pl0x instruct kevin to rebuild this pull request label Oct 6, 2026
@SFTbot SFTbot removed the kevin-rebuild-pl0x instruct kevin to rebuild this pull request label Oct 6, 2026
@TheJJ TheJJ added nice new thing ☺ A new feature that was not there before area: buildsystem Related to our cmake/python buildsystem labels Oct 6, 2026
TheJJ added 24 commits October 17, 2026 22:51
- ubuntu: install ccache in the devenv image, mount a cached ccache dir
  into the build container, and launch compilers through ccache
- macos: replace never-hitting timestamp cache keys with content keys
  (ccache per commit, deps per workflow file) and drop --force from
  brew installs so cached installs are not relinked every run
deduplicate 'find files in these locations, filter by check_files'.

also convert to using Path
matching location has to be Path-converted
ruff and ty accept directories and direct files, and filter
directories themselves via the pyproject.toml config, so the
explicit check_files filtering is redundant for them.

Side effect: --only-changed-files no longer restricts ruff/ty to
changed files; they always check all python locations, which costs
well under a second.
C++ module sources (FILE_SET CXX_MODULES) can only be built by
generators with dependency scanning; the Makefile generator rejects
them. Ninja is now the default, --makefile-generator opts out for
module-free builds.
add_sources(... MODULE ...) adds files to the target's CXX_MODULES
file set instead of the regular sources, so the ninja generator
scans and orders them for module compilation.
cmake 3.28 is the first release with C++ module support
(FILE_SET CXX_MODULES); C++26 matches the compiler floor the
modules work is targeting.
RULE_LAUNCH_COMPILE is deprecated and its wrapper interferes with
the ninja module dependency scanning; the launcher property is the
supported mechanism and matches what CI already passes.
color.h disappears; color.cpp exports the module openage.util.color and
console.h imports it. The source is registered via the new MODULE
modifier of add_sources, which routes it into the CXX_MODULES file set.
Build commands are just recipes now; the minimum compilers are
gcc 16 and clang 21.
The configure hint and the kevin CI jobs call just recipes, and
CheckCompilerFeatures.cmake states the new minimum compiler versions.
The nix derivation and the ubuntu 26.04 devenv image provide just and ninja.
The distro package lists gain just and ninja, bare 'just' lists the
recipes and 'just build' builds. macOS builds with Homebrew's LLVM for
C++26 module support. gentoo.md moves from layman to eselect repository.
The progress counter shows [0/31] to [30/31] for 31 tests because the
0-based enumerate index is passed to format_progress unchanged.
Pass idx + 1 instead.
TheJJ added 5 commits October 17, 2026 22:51
try_compile with SOURCES_TYPE CXX_MODULE builds a module unit and an
importing consumer, so a lacking compiler or generator fails configure
with a clear message instead of a cryptic build error later.
Replace the nyan includes with `import nyan;`. The import goes after all
include blocks: textual includes that follow an import of a module which
saw the same headers break GCC's std handling.

Files that relied on nyan's transitive std includes now include what
they use.
Replace mom.h/mom.cpp with cat.h/cat.cpp: the same guidelines, re-themed
with cats and Aperture Science, and now documenting that module imports
come after all includes.
@TheJJ TheJJ added the kevin-rebuild-pl0x instruct kevin to rebuild this pull request label Oct 17, 2026
@SFTbot SFTbot removed the kevin-rebuild-pl0x instruct kevin to rebuild this pull request label Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: buildsystem Related to our cmake/python buildsystem nice new thing ☺ A new feature that was not there before

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade to C++26

2 participants