feat: Add C++ modules support - #1530
Conversation
✅ Deploy Preview for dpp-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
e91eaa8 to
121eb9b
Compare
Mishura4
left a comment
There was a problem hiding this comment.
Thanks for the PR! Good stuff. Just gonna prefer the approach with including dpp.h in the module for maintainability, as discussed in https://discord.com/channels/825407338755653642/825411104208977952/1454456223952011427
braindigitalis
left a comment
There was a problem hiding this comment.
some module related unit tests would be good. not repeating a thousand lines of code in dpp.cppm is an absolute must, as @Mishura4 also said.
|
I've looked at the |
|
I think that in this case you might want to make a new .cpp under the unittests folder which imports dpp instead of #including it. it can have some test functions that are exported and called via standard approaches from the main unittest file. |
1909f3f to
7f6fb23
Compare
|
I think this should fix the errors we're encountering. It's with the build system configuration |
|
you cant just do -DDPP_MODULES=ON for the entire CI matrix. Some CI's use older g++ (which we support) and some use C++17. |
|
Then is it possible to disable the modules unit tests for C++17 CI tests? |
|
@braindigitalis I think the modules CI should just be in a totally separate CI. It requires Ninja, as CMake can't build modules with Makefiles. |
|
unit tests only run in one g++, which is g++-12. This is the one which is packaged. we cant and dont run unit tests on them all, as the unit tests connect to discord and we cant do this concurrently. |
|
Updated Title to match code standards |
Mishura4
left a comment
There was a problem hiding this comment.
Example doesn't seem to build on Windows. Can we add it to CI somehow?
Also, please fix merge conflicts.
|
|
||
| set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic") | ||
|
|
||
| # Create gcm.cache directory and symlink to the main build's dpp.gcm |
There was a problem hiding this comment.
Clang obtains the BMI paths through -fprebuilt-module-path which indicates where to scan, but GCC has no such option, and places its BMIs in gcm.cache/, which is why the lookup location is populated with the symlink to the actual interface.
There was a problem hiding this comment.
Why is this necessary? I've not had to do this with any of my other projects
Jaskowicz1
left a comment
There was a problem hiding this comment.
A couple comments, nothing to really reject for though
|
ngl i'm pretty happy with moving to clang-cl for windows lol |
This pull request adds support for C++20 modules.
In order to accomplish this, some constants were changed to using external linkage.
I have also updated nlohmann/json to version 3.12.0, as the older version declares some symbols as internal.Updating nlohmann/json has been moved to #1596.Code change checklist