Skip to content

Proper fmt and std modules support (starting with v11.0.0) #5

@Klaim

Description

@Klaim

Version v11.0.0 of fmt is now correctly supported using CMake and also provides a way to make fmt use std if import std; is working. We need to

  • fix current fmt modules support (it's broken and limited in several ways)
    • there is a missing mechanism so that the tests can know if they need to set cxx.features.modules = true when config.fmt.enable_modules as been set to true for the fmt package and not a configuration-wide value. I started experimenting with a solution this several weeks ago but had to stop and couldnt resume exploring this yet.
    • currently the lib{fmt} target will expose either headers OR a module but not both. The recent upstream version however does support providing both in the same target because there is an optional support for having the fmt module's code using external "C++" { which makes it part of the global module instead of the fmt module. This allows code that includes and imports fmt to still work (with consequences on the link-side). Ideally, we would support both exclusively-module, exclusively headers and "both" cases. That should be easy to provide. We also need tests for that "both" case.
  • add a configuration option to enable using import std; inside the fmt module (new v11 feature, see upstream release note)
  • add configurations in the manifests to run the tests using the modules versions of fmt on build2's CI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions