Add meson option to not install the library #2940
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces a Meson build option to allow users to disable the installation of the Catch2 library when using it as a subproject wrap.
The added
install
Meson option lets users include Catch2 as a subproject withdefault_options: ['install=false']
, effectively preventing it from being installed alongside the main project or library. For example:Catch2's primary purpose is for testing, and when included as a wrap, its installation is often unnecessary. In scenarios where Catch2 is used as a testing dependency, users typically don't want it to be installed with their project.
Currently, the Meson build system doesn't natively support disabling the installation of wraps. While Meson offers a
--skip-subprojects
flag during installation, it must be manually specified every timemeson install
is run, which can be cumbersome and error-prone.This change streamlines the process, improving user experience by eliminating the need for repetitive manual configuration. It aligns with the expected use cases for Catch2 when employed as a testing utility.