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

Strict cmake options #281

Merged
merged 2 commits into from
Jan 4, 2024
Merged

Conversation

ursfassler
Copy link
Contributor

@ursfassler ursfassler commented Jan 3, 2024

Summary

Cmake now fails when an option is enabled but a needed dependency is missing.

Details

To not fail too much, only the minimal set of options to use cucumber-cpp is enabled by default.

Test frameworks are off by default because every one has an external dependency. A warning is shown when no test framework is selected as one is needed for cucumber-cpp to be usable.

Motivation and Context

When a developer enables an option she want to use this feature. At the moment, the option can be enabled but when the dependency is not found that feature is not included.
With this change, cmake fails if a dependency for an enabled option is not found.

How Has This Been Tested?

Manually by configuring the project with cmake. Changes in the CI script also reflect the changes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

This change possibly breaks some existing CI because no test framework is selected by default. The warning message shows what the problem is and how it can be solved.

Checklist:

  • It is my own work, its copyright is implicitly assigned to the project and no substantial part of it has been copied from other sources (including Stack Overflow). In rare occasions this is acceptable, like in CMake modules where the original copyright information should be kept.
  • I'm using the same code standards as the existing code (indentation, spacing, variable naming, ...).
  • I've added tests for my code.
  • I have verified whether my change requires changes to the documentation
  • My change either requires no documentation change or I've updated the documentation accordingly.
  • My branch has been rebased to main, keeping only relevant commits.

@ursfassler ursfassler force-pushed the strict-cmake-options branch 2 times, most recently from 74d840b to a7e8c4b Compare January 3, 2024 16:33
This is to reduce error output since cmake fails when an option is enabled
but a dependency for it not installed.

Test frameworks are off by default because every one has an external
dependency. A warning is shown when no test framework is selected as one is
needed for cucumber-cpp to be usable.
@ursfassler ursfassler marked this pull request as ready for review January 3, 2024 16:57
@ursfassler ursfassler merged commit 4b0eb60 into cucumber:main Jan 4, 2024
2 checks passed
@ursfassler ursfassler deleted the strict-cmake-options branch January 4, 2024 17:52
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.

1 participant