-
-
Notifications
You must be signed in to change notification settings - Fork 173
Export missing symbols and fix CMakeLists.txt for modules #273
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
Conversation
is_*
booleans and fix CMakeLists.txt for modules
is_*
booleans and fix CMakeLists.txt for modules
@marzer @N-Dekker I noticed some parts of the |
Are there any concerns or questions about my PR before you can have it merged? |
Hi there, erm, no concerns for me personally. I'm only keeping an eye on the modules stuff from a distance, so any changes here I think are largely between you and @N-Dekker to figure out 😅 (I don't know what the reasoning was behind the symbol export changes 🤷🏼♂️) |
OK, sounds good. Let's hear what @N-Dekker has to say about the CMake changes then before finalising these changes |
Thanks for your effort @mikomikotaishi Unfortunately, I don't have experience with C++ modules, other than by trying out your contribution! And so far, I could not make the tomlplusplus module work on my side, mainly because of MSVC compiler bugs. For a feature like this, I think it's necessary to have unit tests, running on the CI. (Unless we want to keep it in some sort of experimental status, of course.) However, for me it would already help if it can be made compatible with MSVC, so that I can try it out at home 🤷 @marzer Can you please merge my pull request #271? Then afterwards I can give this PR (#273) a try on MSVC. |
@marzer Thanks for merging my pull request #271 Sorry I kept it in "draft" status for too long! Obviously it's just a workaround, to make MSVC happy! @mikomikotaishi Can you please rebase you pull request branch, so that I can try it out with MSVC? Do a
Assuming |
I merged the changes in, try it now @N-Dekker |
@N-Dekker Did you have any trouble getting it to work? Let me know if anything went wrong |
No, I just didn't have time yet. Is there a specific deadline for this feature, that I can take into account? |
No, I suppose not, but it would be nice to merge it as soon as possible. I have started using the tomlplusplus module myself and because it is missing those symbols it creates problems which I have to manually resolve. |
As there are no unit tests for the module, I'm just locally adjusting an existing test (example), "examples/error_printer.cpp", trying to get it to work with the module: Instead of the
Unfortunately it still produces link errors with MSVC
Are you able to locally adjust your "examples/error_printer.cpp" to do |
I used it here in this file that just re-exports all the symbols in the library, and it compiles fine on Clang. Also, can you explain why you added |
@mikomikotaishi Thank you for trying! But sorry, I feel it's a pity that you do not use the module implementation from toml++ itself. It's your own proposal! It will give other users more trust in this great new toml++ feature, when the original author of the feature uses it directly!
Thanks for asking, @mikomikotaishi ! The problem is that the example itself does tomlplusplus/examples/error_printer.cpp Line 164 in 8eb4012
I haven't yet figures out how to deal with macro's that are part of the interface, when using modules. If I understand correctly, end-users should be able to have such an |
Well, they don't have to have it, since it's optionally-user configurable, with a default value if the user hasn't overridden it. But yeah probably whatever that value is, be it defaulted or user-specified, should find it's way into the code that consumes the module. |
@marzer @N-Dekker I see, however the matter with
I would argue I am using it, I just have to re-alias those types to match the PascalCase style I am using for object names.
Modules cannot export macros, header units (headers that are Anyway, could the PR be merged now? The PR here mostly pertains to features that I forgot to add in the first PR and I would just want to have that rectified. |
I mean, sure, but that's somewhat a distinction without a difference for most people given the current state of tooling, and not really what I meant. Header units are bridging measure introduced as part of the broader C++ modules language feature. People consuming the library that way need the macro in the same way people using regular
Yeah, sure, it looks fine to me |
What does this change do?
This commit amends the module file to export some missing symbols, such as those of the name
is_*
, updatesCMakeLists.txt
inmodules
to fix a failure to compile, and renamestomlpp.cppm
totomlplusplus.cppm
, so that the file name aligns with the name of the module.Is it related to an exisiting bug report or feature request?
No, but it is related to a previous commit (#266).
Pre-merge checklist
origin/master
(if necessary)