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:
Stephen Kelly 2013-02-07 12:33:20 +01:00
parent 4cf161a5e7
commit 57175d559e
2 changed files with 15 additions and 3 deletions

View File

@ -434,8 +434,17 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
// No error. We just skip cyclic references.
return std::string();
case cmGeneratorExpressionDAGChecker::ALREADY_SEEN:
// No error. We're not going to find anything new here.
return std::string();
for (size_t i = 0;
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:
break;
}

View File

@ -103,4 +103,7 @@ target_compile_definitions(depG INTERFACE
)
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>)