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

spdlog wrap: Option to disable installation of headers. #1907

Closed
wants to merge 2 commits into from

Conversation

sebastianstricker
Copy link

Added a meson option to specify whether or not to install headers.

Installing headers and pkg-config files is not always wanted, especially as spdlog is naturally used as a subproject. After compilation, one does not need the header files anymore, except when compiling spdlog as a shared library.

This patch adds an option to disable installation, but does not change the current default behaviour. The current CMAKE build file of spdlog currently contains this option as well, so it only makes sense to replicate it.

Sebastian Stricker and others added 2 commits February 3, 2025 17:25
…l headers.

Installing headers and pkg-config files is not always wanted, especially as spdlog is naturally used as a subproject. After compilation, one does not need the header files anymore, except when compiling spdlog as a shared library.

This patch adds an option to disable installation, but does not change the current default behaviour.
The current CMAKE build file of spdlog currently contains this option as well, so it only makes sense to replicate it.
@stephanlachnit
Copy link
Contributor

stephanlachnit commented Feb 5, 2025

If you are using spdlog as a static library, this should be solved by using

meson install --skip-subprojects spdlog

Unfortunately, it is not possible to set this in Meson directly.

Alternatively, we could use meson.is_subproject() to check if this is a subproject and if only a static library is built, then skip the installation. But this would be a bit annoying since in principle this would need to be done in every wrap.

@stephanlachnit
Copy link
Contributor

Best case scenario would be a skip_install_if_subproject built-in option in Meson, which defaults to false, but can be set to true in subproject() and dependency().

@sebastianstricker
Copy link
Author

sebastianstricker commented Feb 6, 2025

If you are using spdlog as a static library, this should be solved by using

meson install --skip-subprojects spdlog

Unfortunately, it is not possible to set this in Meson directly.

Thanks for the reply, I was unaware of the --skip-subprojects option. As you said, I expected to find that functionality in either subproject() or dependency(), as I'd ideally like to predefine the behaviour in the meson.build file, not the install command.

I am not sure if I this covers all use cases, however, I'll close this for now as it resolves my issue at least!

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.

2 participants