diff options
author | Brad King <brad.king@kitware.com> | 2024-04-11 17:37:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-04-11 22:35:40 (GMT) |
commit | c94cfe92eb579b07ab7a9bbb66d98090ec6fe840 (patch) | |
tree | c783b90c706b39003675487eb027c31afdb718e5 /Tests/CompatibleInterface | |
parent | 061f7a6b9756bafa2d3d2f0ce86b6abd2b2e4598 (diff) | |
download | CMake-c94cfe92eb579b07ab7a9bbb66d98090ec6fe840.zip CMake-c94cfe92eb579b07ab7a9bbb66d98090ec6fe840.tar.gz CMake-c94cfe92eb579b07ab7a9bbb66d98090ec6fe840.tar.bz2 |
GenEx: Fix COMPATIBLE_INTERFACE_ evaluation outside usage requirements
In commit ff6c401309 (cmTarget: Add interface for compatible numeric
properties, 2013-10-22, v3.0.0-rc1~460^2) the condition
dagCheckerParent && !dagCheckerParent->EvaluatingLinkLibraries()
was written that way to avoid a nullptr dereference, but is actually
meant to say "is not evaluating link libraries". That can also be true
when there is no `dagCheckerParent`, such as when evaluating a generator
expression outside of usage requirements, e.g., for `add_custom_target`.
The original commit tried to account for that by duplicating the
implementation in another code path, but that did not work in all cases.
Fix the condition, remove the duplication, and enable tests for the
now-working cases.
Diffstat (limited to 'Tests/CompatibleInterface')
-rw-r--r-- | Tests/CompatibleInterface/CMakeLists.txt | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Tests/CompatibleInterface/CMakeLists.txt b/Tests/CompatibleInterface/CMakeLists.txt index 4927329..5d57ce4 100644 --- a/Tests/CompatibleInterface/CMakeLists.txt +++ b/Tests/CompatibleInterface/CMakeLists.txt @@ -228,9 +228,8 @@ add_custom_target(check ALL VERBATIM "ON" "$<TARGET_PROPERTY:static1,BOOL_PROP5>" "prop4" "$<TARGET_PROPERTY:static1,STRING_PROP4>" - #FIXME: These two cases do not work correctly. - #"6" "$<TARGET_PROPERTY:static1,NUMBER_MIN_PROP6>" - #"4" "$<TARGET_PROPERTY:static1,NUMBER_MAX_PROP4>" + "6" "$<TARGET_PROPERTY:static1,NUMBER_MIN_PROP6>" + "4" "$<TARGET_PROPERTY:static1,NUMBER_MAX_PROP4>" "ON" "$<TARGET_PROPERTY:object1,BOOL_PROP5>" "prop4" "$<TARGET_PROPERTY:object1,STRING_PROP4>" |