Commit Graph

3 Commits

Author SHA1 Message Date
Ben Boeckel
437280b127 cxxmodules: scan C++ sources for imports by default
Existing projects are not using C++ modules in their sources,
so introduce policy CMP0155 to enable scanning by default.
2023-10-02 10:17:31 -04:00
Ben Boeckel
1e9ec93f48 Tests/RunCMake/CXXModules: actually generate the source at build time
This tests what is intended to be tested (sources that do not exist
until after the configure has run).
2023-08-07 19:14:45 -04:00
Ben Boeckel
8c5a53096a Tests/RunCMake/CXXModules: add module-using examples
This includes a number of examples that should work for various levels
of support in a compiler.

There are a number of tests which are gated on various features in the
compilers. To enable the tests, set `CMake_TEST_MODULE_COMPILATION` to a
comma-separated (to avoid `;`-escaping problems) to the list of features
which are supported:

  - `named`: Named modules are supported.
  - `shared`: Shared libraries with module usage at the API boundary are
    supported.
  - `partitions`: Named module partitions are supported.
  - `internal_partitions`: Named module internal partitions are
    supported.

Additionally, a `CMake_TEST_MODULE_COMPILATION_RULES` file must be
passed which contains the rules for how to build modules using the
provided compiler. It will be included in the tests to provide these
rules. To verify that the file provided works as intended, it must set
`CMake_TEST_CXXModules_UUID` to a specific version to indicate that it
is an expected file.
2022-06-16 10:28:34 -04:00