-
Notifications
You must be signed in to change notification settings - Fork 120
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
Quoted #include pattern picks up wrong (packaged) fmt library #21
Comments
I made a few changes that build and install https://github.com/gh-andre/fmtlog I'm not creating a pull request, though, because I think you would have more people using
I think this would make it simpler for many to start using EDIT:
|
@MengRao I made some CMake changes to build one configuration at a time (Debug or Release) and link against matching https://github.com/gh-andre/fmtlog/tree/cmake-debug-release Not creating a pull request because the part with the bundled |
I didn't want to create a new non-issue issue, so I will just post in this thread. I added GitHub workflow for a test build. You can see the results in a couple of latest runs on Windows and Ubuntu. https://github.com/gh-andre/fmtlog/actions I didn't create a pull request because it uses patched CMake files, which you didn't port. The one in https://github.com/gh-andre/fmtlog/blob/main-patches/.github/workflows/fmtlog-verify-build.yaml In their current configuration they build only manually in Actions, but you can change Note that on Windows it cannot build DLL because there's no Also, worth noting that all builds are made with Debug and Release configurations because otherwise |
Thank you for the logging library. It fits background logging quite well, leaving threading to the application, which many other logging libraries lack. One thing I wanted to mention is a small build issue in configurations that already have a packaged version of
fmt
installed.A quoted
#include
pattern always looks in the current directory and only then in the search path. Iffmtlog
is installed on a system that already has a packaged version offmt
installed (e.g. viadnf
), this causes the wrong headers picked up.That is,
fmtlog.h
contains this line:All compilers always check current directory, which always fails, and then the search path is checked. On systems where
fmt
is installed via a package manager, such as CentOS 8, there will be a version in/usr/include/fmt/
, which would be picked via the search path.Given that
libfmt
includesfmt
as a Git submodule, it should always include the version offmt
in its own source subtree, which can be done by using quoted#include
pattern to include the header relative to the directory of thefmtlog.h
file:In this case this line can be removed from
CMakeLists.txt
as well:These two changes allow both versions of
fmt
coexist without a conflict - one is in the packaged location and one under/usr/local/include/fmtlog/fmt/
, or any other directory suitable for a given project.The text was updated successfully, but these errors were encountered: