Skip to content

First try of making standard C++ modules buildable#139

Draft
GPMueller wants to merge 1 commit intomasterfrom
feature-modules
Draft

First try of making standard C++ modules buildable#139
GPMueller wants to merge 1 commit intomasterfrom
feature-modules

Conversation

@GPMueller
Copy link
Copy Markdown
Contributor

A trivial MWE module can be built, a more complete module using module partitions cannot be automatically built yet, because there seems to be no way to let clang-15 tell us the dependencies between the partitions. The user would have to manually specify the interdependencies, which doesn't seem desirable for clang-build to require.

These changes do not attempt to lay groundwork for any well-designed implementation of modules support. Instead, it's just trying to get things to compile.

A trivial MWE module can be built, a more complete module using module
partitions cannot be automatically built yet, because there seems to be
no way to let clang-15 tell us the dependencies between the partitions.
The user would have to manually specify the interdependencies, which
doesn't seem desirable for clang-build to require.

These changes do not attempt to lay groundwork for any well-designed
implementation of modules support. Instead, it's just trying to get
things to compile.
@GPMueller GPMueller added the enhancement New feature or request label Feb 5, 2023
@GPMueller GPMueller linked an issue Feb 5, 2023 that may be closed by this pull request
@GPMueller
Copy link
Copy Markdown
Contributor Author

Note: I have placed --precompile onto the .cppm files for the first compilation phase. Unfortunately, if the file is not yet compilable, this will fail with e.g.

test\cpp-modules\full-module\hello_world-impl_world.cppm:7:9: fatal error: module 'hello_world:world' not found
import :world;
~~~~~~~~^~~~~

If we'd use --preprocess, like we do on .cpp files to determine their dependencies, we'd not get an error at this stage, but we'd also not get the precompiled .pcm files, which would allow us to speed up the second compilation phase.

Unfortunately, in clang-15, neither with--precompile nor --preprocess will the -MMD/--write-user-dependencies flag output import-dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for modules

1 participant