Skip to content

feat: make C++ standard a first-class build setting #98

@Sunrisepeak

Description

@Sunrisepeak

Motivation

[package].standard is parsed today, but C++ compile flags and import std BMI prebuilds still have C++23 hardcoded in key places. Users can currently work around C++26 by adding -std= in build.cxxflags, but that bypasses the intended manifest/fingerprint/std-module model and can leave cached std BMIs built with the wrong dialect.

Scope

  • Treat the active C++ standard as a first-class build setting, defaulting to C++23.
  • Support C++26 spellings such as c++26 and c++2c, with room for GNU dialect aliases.
  • Ensure build flags, fingerprinting, compile_commands, and std module BMI prebuilds consume the same active standard.
  • Add metadata validation for cached std module BMIs so import std cannot reuse a BMI built with a different C++ standard.
  • Keep build.cxxflags as additional C++ flags, not the language-standard configuration path.
  • Update docs and regression coverage.

Design Notes

The design draft is tracked in .agents/docs/2026-06-01-cpp-standard-first-class-design.md.

Test Plan

  • Unit tests for manifest standard parsing and aliases.
  • Unit tests for generated build flags and std module build commands.
  • E2E coverage for C++26 flags in build.ninja and compile_commands.
  • Toolchain-gated import-std checks where supported by the CI environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions