-
Notifications
You must be signed in to change notification settings - Fork 4.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
How exactly is SPDLOG_FMT_EXTERNAL supposed to be enabled? #2310
Comments
Setting the CMake option is the preferred way. |
Let me see if I understand this correctly:
The concern among Homebrew's packagers (whom I don't speak on behalf of, I'm just some random Homebrew and spdlog user) is that some people may choose to use spdlog from Homebrew without using pkg-config, which is apparently a use-case they wish to support. For the time being, I think the approach Homebrew will take is to keep passing the option to cmake, but also change tweakme.h to contain:
Does this seem like a reasonable (at least short-term) solution? And for the future, would it be possible for spdlog to generate a |
Would it make sense for upstream to, at the very least, change the tweakme.h file to uncomment As it stands, a user installing via a package manager would have to manually change the tweakme.h. This is a bit odd, having to tell spdlog "yes, I want it to behave as it was compiled to do please". |
I think it would be useful to define |
The following line set the compile definition for CMake and indirect for pkg-config.
The following line should ensure that the compile definition is set for a
|
Does the |
Hi, @gabime I'm unable to find any associated commits - was this completed or just closed? |
@ainola, This is outside of the scope of spdlog. Homebrew can install a modified tweakme.h file. |
Not sure why this is outside the scope... this is quite literally about spdlog's compilation behavior. :) |
There is no plan to automatically generate modified tweakme.h file. That being said, a PR is always welcome. |
There are two ways to tell spdlog that it's supposed to use an external libfmt rather than its own bundled copy: You can compile spdlog with
cmake -DSPDLOG_FMT_EXTERNAL
, which adds-DSPDLOG_FMT_EXTERNAL
to the CFlags section of spdlog.pc (and thus adds that flag to the command line), or you can uncomment#define SPDLOG_FMT_EXTERNAL
intweakme.h
. Either version works by itself, but if you both uncomment the line intweakme.h
and add the flag to cmake, you get a macro redefinition warning.Currently, the Homebrew package does both approaches (as reported in Homebrew/homebrew-core#88896). Clearly, it has to either stop changing
tweakme.h
, or stop providing-DSPDLOG_FMT_EXTERNAL
. Which approach is the most "correct" when packaging spdlog as a library? Should changingtweakme.h
be preferred or should the cmake build option be preferred?The text was updated successfully, but these errors were encountered: