-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add support for CMake 3.28 C++ module features #3679
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR but the part of CMake you are changing is deprecated and will be removed. Please add this to add_module_library
instead.
Hi @vitaut - thanks for the review. However if this is not the best way, I'm happy to move the conditional out of |
Sorry, I just realized that it's not super clear from the code and my comment but what I meant is that the source of truth of |
I merged it for now but as commented earlier it will be overwritten unless also added to the main modules repo. Thanks! |
Revered because of incompatibility with CMake 3.16: #3714. |
Apologies @vitaut - I will make the contribution in the main modules repo and make sure there's no regression with older CMake. |
No worries and thanks for working on this. |
CMake 3.28 (rc1 announcement) adds support for C++ modules that is no longer experimental (so no need to add the experimental flags).
This PR adds support for this using the new features, when the build is configured with
FMT_MODULE
set toON
and the CMake version is 3.28 or higher.Tested both building fmt, and then calling
cmake install
and using the fmt module from a different project. This works with:find_package(fmt)
works with Ninja, but not with the Visual Studio generator - reported this here.Hopefully this is OK. For CMake versions earlier than 3.28, this should behave as it was previously.