-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Auto generate tweakme.h #3077
Comments
CMake shouldn't generate |
I think it should be auto-generated for feature parity with pkg-config and CMake configurations. |
Sorry. I am not a native speaker so I misunderstood the meaning. spdlog was initially a header-only library. The option to build as a shared or static library was added later. The final decision must be made by the maintainer @gabime. |
Auto-generation can be enabled only if the |
|
Yes, but it has major issues with packages not using pkg-config or CMake. For more information please check this ticket. |
I’ve been working on something like this in the v2.x branch. cmake would generate a config.h file. Not sure yet if this the right approach though.. |
If this is considered a major change, it would make sense to automatically generate a configuration file from v2. |
Looks good. Is it possible to backport this to 1.x? |
Porting it to v1.x would break current usage of tweakme.h or add confusion if generate a new file in addition to tweakme.h. |
Even if it will be optional and disabled by default? If enabled, the |
How would the new config.h be included by the code? Also note that when consuming spdlog |
If a macro was defined when the library was built, CMake will define the same macro for the application to be linked. |
Something like that: #if __has_include(<spdlog/config.h>)
#include <spdlog/config.h>
#else
#include <spdlog/tweakme.h>
#endif
Yes, but we're talking about a situation where the packages don't use pkg-config or CMake. |
__has_include is c++17 while spdlog v1.x is c++11 |
Another option is to install the generated |
Perhaps a PR is welcme. |
It looks like the
include/spdlog/tweakme.h
file should be automatically generated by CMake depending on the build configuration.Various Linux distributions need to manually patch it in downstream to resolve issues with packages not using pkg-config or CMake.
The text was updated successfully, but these errors were encountered: