Skip to content
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

Fix spdlog handling of external fmt lib #4994

Merged
merged 3 commits into from
Dec 21, 2018
Merged

Fix spdlog handling of external fmt lib #4994

merged 3 commits into from
Dec 21, 2018

Conversation

cneumann
Copy link
Contributor

Using an external fmt lib should cause the spdlog::spdlog target to have
a dependency on fmt lib - so that a consuming project does not need
to call find_package(fmt) and target_link_libraries(... fmt::fmt).

To this end a new cmake option SPDLOG_FMT_EXTERNAL is introduced which
makes spdlog depend on fmt lib and defines the SPDLOG_FMT_EXTERNAL macro
to avoid using the bundled fmt lib. The value of SPDLOG_FMT_EXTERNAL is
also stored in the installed spdlogConfig.cmake and if it is ON
find_dependency() is used to ensure the fmt::fmt target is imported.

Using an external fmt lib should cause the spdlog::spdlog target to have
a dependency on fmt lib - so that a consuming project does not need
to call find_package(fmt) and target_link_libraries(... fmt::fmt).

To this end a new cmake option SPDLOG_FMT_EXTERNAL is introduced which
makes spdlog depend on fmt lib and defines the SPDLOG_FMT_EXTERNAL macro
to avoid using the bundled fmt lib. The value of SPDLOG_FMT_EXTERNAL is
also stored in the installed spdlogConfig.cmake and if it is ON
find_dependency() is used to ensure the fmt::fmt target is imported.
@msftclas
Copy link

msftclas commented Dec 17, 2018

CLA assistant check
All CLA requirements met.

@cneumann
Copy link
Contributor Author

Upstream was very quick to merge the corresponding change there (gabime/spdlog#945). I suppose the alternative to applying this here would be to update the port to tip of branch spdlog v1.x. Any preference?

@Rastaban Rastaban self-assigned this Dec 20, 2018
@Rastaban
Copy link
Contributor

I am okay taking the released version and adding a patch. I added a comment so whoever updates to the next version knows to remove the patch. I am running regression tests now.

@Rastaban Rastaban merged commit 501abec into microsoft:master Dec 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants