-
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
What is the proper way to use fmt as a C++ 20 module? #4237
Comments
Thanks for the suggestion. We should add a section to the docs and in the meantime check out https://vitaut.net/posts/2023/simple-cxx20-modules/. |
The docs probably belong here: https://github.com/fmtlib/fmt/blob/master/doc/get-started.md. |
I've tried this exact tutorial but it only worked with I'm using NixOS which might be part of the problem, how would I debug what is going wrong?
|
@yuannan I had a play with this and managed to get it working with a change: Building with clang 18.1.8, cmake 3.31.0, c++ std c++20 or c++23 on Ubuntu, fmt trunk Configure line: However, I had to hack this Lines 74 to 77 in 9ced61b
To I don't know if this is a known bug, with ninja, cmake, or how fmtlib is setup, or some combo. From a cursory scan, fmtlib seems to do it right but I'm no expert with modules |
Could be related to vitaut/modules#16. |
I've seen loads of different examples online, but nothing seems to be in the official documents.
Some people have suggested to wrap fmt in a module and include that, while others have directly included it as a subdirectory in CMake.
I'm a little bit lost as what is the officially supported way to do this.
I'm building a new logging library specifically targeting cpp 23+ using fmt and I would really appreciate some input.
https://gitlab.com/Simple-Cpp/SplLog
Currently it compiles just fine on NixOS, but that is using the older 10.2.0 version that Nix ships. If I try to include as a git submodule and a cmake subdirectory it seems to explode while looking for
__fwd/string
.Trying to use 10.2.0 from git but matching to the version Nix ships brings it's own compile issues.
If you can guide me on how to do this, I'd be happy to update the docs to make it a bit easier for new users.
The text was updated successfully, but these errors were encountered: