Skip to content

Make tests and example optional - #153

Merged
vitaut merged 1 commit into
vitaut:mainfrom
miyanyan:cmake-options
Sep 6, 2026
Merged

vitaut merged 1 commit into
vitaut:mainfrom
miyanyan:cmake-options

Conversation

@miyanyan

Copy link
Copy Markdown
Contributor

Follow-up to #149.

@vitaut

vitaut commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR but could you provide some details about the motivation?

@miyanyan

miyanyan commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the PR but could you provide some details about the motivation?

Thanks for the review. The main motivation is to make zmij available through vcpkg so that users can install and integrate it more easily. When zmij is consumed as a library, users should not be required to build its tests and examples. These options allow package managers and downstream projects to disable them, much like the FMT_TEST option in fmt

Comment thread CMakeLists.txt Outdated
Comment on lines +9 to +10
option(ZMIJ_BUILD_TESTS "Build tests" ON)
option(ZMIJ_BUILD_EXAMPLES "Build examples" ON)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename to ZMIJ_TEST and ZMIJ_EXAMPLE to follow fmt's convention and since this is about generating targets, not building. And update the descriptions accordingly, e.g. "Generate the test targets"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@vitaut
vitaut merged commit 6ecb998 into vitaut:main Sep 6, 2026
3 checks passed
@vitaut

vitaut commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Merged, thank you

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