Only use early evaluation termination for transitive properties.
We need to make sure expressions which evaluate TARGET_PROPERTY:TYPE multiple times for example get the correct result each time, and not an empty string instead.
This commit is contained in:
parent
4cf161a5e7
commit
57175d559e
|
@ -434,8 +434,17 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
||||||
// No error. We just skip cyclic references.
|
// No error. We just skip cyclic references.
|
||||||
return std::string();
|
return std::string();
|
||||||
case cmGeneratorExpressionDAGChecker::ALREADY_SEEN:
|
case cmGeneratorExpressionDAGChecker::ALREADY_SEEN:
|
||||||
// No error. We're not going to find anything new here.
|
for (size_t i = 0;
|
||||||
return std::string();
|
i < (sizeof(targetPropertyTransitiveWhitelist) /
|
||||||
|
sizeof(*targetPropertyTransitiveWhitelist));
|
||||||
|
++i)
|
||||||
|
{
|
||||||
|
if (targetPropertyTransitiveWhitelist[i] == propertyName)
|
||||||
|
{
|
||||||
|
// No error. We're not going to find anything new here.
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
}
|
||||||
case cmGeneratorExpressionDAGChecker::DAG:
|
case cmGeneratorExpressionDAGChecker::DAG:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,4 +103,7 @@ target_compile_definitions(depG INTERFACE
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(targetC targetC.cpp)
|
add_executable(targetC targetC.cpp)
|
||||||
target_link_libraries(targetC depG)
|
# Creates a generator expression for include directories like
|
||||||
|
# $<$<TARGET_DEFINED:$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:depG>>:\
|
||||||
|
# $<TARGET_PROPERTY:$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:depG>,INTERFACE_INCLUDE_DIRECTORIES>>
|
||||||
|
target_link_libraries(targetC $<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:depG>)
|
||||||
|
|
Loading…
Reference in New Issue