-
Notifications
You must be signed in to change notification settings - Fork 373
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
C++20 module support #1026
Comments
Thanks for providing the notes on your investigation. I think explicit support will be required to avoid things being cumbersome/error prone as you've noted. As an aside, it seems like setting C++20 in AdditionalOptions shouldn't be needed for Intellisense as that should automatically extracted from the CompilerOptions. |
I want to add that with partitions, things became even "better". Me and friend of mine have a medium-sized pet project with nearly 50+ projects and hundreds of modules. We also trie to integrate FastBuild at our current job, so I wanted to learn by integrating it into the pet project. Things became ugly for modules because:
In conclusion, life with modules is possible, but it is very difficult and demands a lot of dedication to integrate them into a "not a small" project. Hopefully, some good standardised solution for FastBuild will be found. Cheers. |
Hi, |
I experimented with fast-building C++20 modules and just wanted to share some observations.
So, this issue is kind of #94 necro.
The good: it can be done as is.
The bad: it is cumbersome and requires a nasty hack in order to express ifc ← obj dependencies.
As CMake now has official support for C++20 modules I gave it (yet another) try. I still do not like it. At all.
I really would like to see C++ module support in FASTBuild. This is despite my doubts that it will be needed for the next 10 years to come.
The observations
Tell the compiler you want module support.
When generating vcxproj files tell Intellisense that you want module support.
Modules files can be build by just passing the proper options.
Module build order is explicitly described via
.PreBuildDependencies
. This can become cumbersome quickly.Object files may depend on ifc files. In general, an obj depends on all module ifc it imports. Consider for example an inline function defined in some ifc and injected into some standard obj. In consequence, we need to rebuild an obj whenever at least one of the ifc it depends on changes. I abused
.CompilerForceUsing
to model this dependency. Again, doing so becomes cumbersome quickly.The text was updated successfully, but these errors were encountered: