-
Notifications
You must be signed in to change notification settings - Fork 181
Make spdlog and fmt mutually exclusive and support -Werror=missing-braces #419
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
Conversation
axsaucedo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution, just getting around - would you be able to provide more context on the comments? + also re-commit with the DCO
Thanks for the feedback. This PR got muddied because I needed to make changes to my fork to make the logger work in my project. I am happy to split it up into two PRs if necessary. The changes are:
For (2), the problem is if I am using spdlog and kompute in my project, if Kompute uses fmt directly (rather than the one inside spdlog), I will get duplicate symbol errors. This error comes from the code including two different versions of fmt. Therefore, I changed Kompute to disable fmt if spdlog is enabled and instead use the fmt headers inside spdlog. This avoids the duplicate symbols by having the same headers, which have Edit: I updated the commits with the DCO. |
axsaucedo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok that makes sense, I have updated the title - we can move forward with single PR
axsaucedo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems python tests are failing on build - once updated we can merge
Signed-off-by: zachferguson <[email protected]> Signed-off-by: Zachary Ferguson <[email protected]>
Signed-off-by: zachferguson <[email protected]> Signed-off-by: Zachary Ferguson <[email protected]>
Signed-off-by: Zachary Ferguson <[email protected]>
I think I fixed this now. It seems that you use fmt for more than logging, so when the logger is disabled, you still need to link against fmt. I made it so disabling the logger also implies using fmt to fix this. |
axsaucedo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch - all clear now, thanks for covering these corner cases
The header files generated by
bin2h.cmakecause an error when the GCC flag-Werror=missing-bracesis enabled. I fixed this by adding another set of braces around${arrayValues}on Line 98.Edit: I pushed some more changes to my fork which automatically got included in this PR. My new changes make use of FMT in SPDLOG instead of the system-installed version.