-
Notifications
You must be signed in to change notification settings - Fork 10
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
Allow making CMake options dependent on others #356
Conversation
bors try |
Performance test reportpika PerformanceComparison
Info
Comparison
Info
Comparison
Info
Explanation of Symbols
|
9e4a8c5
to
c82f8c9
Compare
Performance test reportpika PerformanceComparison
Info
Comparison
Info
Comparison
Info
Explanation of Symbols
|
tryTimed out. |
bors try |
tryBuild failed: |
bors try |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks!
option("${option}" "${description}" "${default}") | ||
else() | ||
cmake_dependent_option( | ||
"${option}" "${description}" "${default}" "${PIKA_OPTION_DEPENDS}" OFF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we set the default to ON
here? It should be ON
if the PIKA_OPTION_DEPENDS
is ON
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We set the default to default
. The last OFF
is the <force>
variable from https://cmake.org/cmake/help/latest/module/CMakeDependentOption.html?highlight=cmake_dependent_option#command:cmake_dependent_option:
Makes <option> available to the user if the [semicolon-separated list](https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#cmake-language-lists) of conditions in <depends> are all true. Otherwise, a local variable named <option> is set to <force>.
i.e. it's the value that is set if the PIKA_OPTION_DEPENDS
condition is not true, which in all cases we have so far should just turn off the option. In theory there could be options that want the inverse, but I think we can add that when we need it.
c82f8c9
to
d5cbaa4
Compare
bors merge |
356: Allow making CMake options dependent on others r=msimberg a=msimberg Fixes #317. Also makes the `PIKA_WITH_TESTS_*` and `PIKA_WITH_EXAMPLES_*` options dependent on `PIKA_WITH_TESTS` and `PIKA_WITH_EXAMPLES`, respectively. If someone spots a possibility to use dependent options elsewhere don't hesitate to just change it. I've kept the old `pika_option` implementation for non-`BOOL` types, and added new variants based on `option` and `cmake_dependent_option`. The `pika_option` function is now a macro because of the scope required for the "hidden" (helper) variables used by `cmake_dependent_option`. Co-authored-by: Mikael Simberg <mikael.simberg@iki.fi>
Build failed: |
bors merge |
356: Allow making CMake options dependent on others r=msimberg a=msimberg Fixes #317. Also makes the `PIKA_WITH_TESTS_*` and `PIKA_WITH_EXAMPLES_*` options dependent on `PIKA_WITH_TESTS` and `PIKA_WITH_EXAMPLES`, respectively. If someone spots a possibility to use dependent options elsewhere don't hesitate to just change it. I've kept the old `pika_option` implementation for non-`BOOL` types, and added new variants based on `option` and `cmake_dependent_option`. The `pika_option` function is now a macro because of the scope required for the "hidden" (helper) variables used by `cmake_dependent_option`. Co-authored-by: Mikael Simberg <mikael.simberg@iki.fi>
Build failed: |
bors merge |
Fixes #317.
Also makes the
PIKA_WITH_TESTS_*
andPIKA_WITH_EXAMPLES_*
options dependent onPIKA_WITH_TESTS
andPIKA_WITH_EXAMPLES
, respectively. If someone spots a possibility to use dependent options elsewhere don't hesitate to just change it.I've kept the old
pika_option
implementation for non-BOOL
types, and added new variants based onoption
andcmake_dependent_option
. Thepika_option
function is now a macro because of the scope required for the "hidden" (helper) variables used bycmake_dependent_option
.