Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GPMueller
Copy link
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
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