-
Notifications
You must be signed in to change notification settings - Fork 5
Add support for C++ modules #205
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
base: main
Are you sure you want to change the base?
Conversation
|
Per the discussions recently, in order to avoid diamond dependency issues when packaging for vcpkg/conan, I may be moving away from any precompilation, and making the entire library header-only. Apologies for the noob questions - I haven't investigated modules at all, having spent all my time on coroutines and concepts instead. I've done some reading and it appears that modules offer a way to do the precompilation that's currently gated behind the TMC_IMPL macro, but in a more elegant fashion? If I just define a normal function as inline (necessary to prevent ODR violation in a header-only library), will modules prevent that from being recompiled in every translation unit, and instead provide a single compilation which can be reused? What is the impact of P1498R1 and P1779R3 on this library? Is there a recommendation that I should make member functions inline or not-inline? There is a typo on line 47: tmc::cpuexecutor Is there a more reliable method to export all of the symbols necessary so that I don't have to remember to update this file while I'm adding a header? In order to ensure that nothing else has been missed, mind forking the examples repo and adding a module build option there? To test there, |
|
Fixed the missing symbols and decided to alphabetise the |
|
Okay, so as you are probably aware, one notable advantage of modules is that modular translation units are compiled once and I believe that modules do not make all functions non-recompiled, but importers only have to compile against the already built module interface to get its definitions. Also, in modules, member functions are not implicitly |
|
@tzcnt Hi, is there anything else you want me to answer? |
|
I won't merge without compiling the full examples suite and tests using the module API. That's why I requested you open a PR into the examples repo. Otherwise I'll do it myself after I work through removing the IMPL macro requirement and review the package manager PRs |
Do you want me to duplicate all of the tests or do you want me to make it conditional on whether |
This PR adds support for C++ modules, which currently must be manually compiled (no
CMakeLists.txtexists).