Add support for CMake 3.28 C++ module features#3679
Conversation
There was a problem hiding this comment.
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_MODULEset toONand the CMake version is 3.28 or higher.Tested both building fmt, and then calling
cmake installand 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.