Commit 122946de authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'genex-GENEX_EVAL-fix-recursion'

e429e9af genex: Fix erroneous handling of recursion for $<GENEX_EVAL:>
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: yrHeTaTeJlb's avataryrHeTaTeJlb <jjj.bo@yandex.ru>
Merge-request: !2954
parents 99ec095d e429e9af
Pipeline #129927 failed with stage
in 0 seconds
......@@ -157,14 +157,8 @@ bool cmGeneratorExpressionDAGChecker::GetTransitivePropertiesOnly()
bool cmGeneratorExpressionDAGChecker::EvaluatingGenexExpression()
{
const cmGeneratorExpressionDAGChecker* top = this;
const cmGeneratorExpressionDAGChecker* parent = this->Parent;
while (parent) {
top = parent;
parent = parent->Parent;
}
return top->Property == "TARGET_GENEX_EVAL" || top->Property == "GENEX_EVAL";
return this->Property.find("TARGET_GENEX_EVAL:") == 0 ||
this->Property.find("GENEX_EVAL:", 0) == 0;
}
bool cmGeneratorExpressionDAGChecker::EvaluatingPICExpression()
......
......@@ -402,8 +402,8 @@ protected:
{
if (context->HeadTarget) {
cmGeneratorExpressionDAGChecker dagChecker(
context->Backtrace, context->HeadTarget, genexOperator, content,
dagCheckerParent);
context->Backtrace, context->HeadTarget,
genexOperator + ":" + expression, content, dagCheckerParent);
switch (dagChecker.Check()) {
case cmGeneratorExpressionDAGChecker::SELF_REFERENCE:
case cmGeneratorExpressionDAGChecker::CYCLIC_REFERENCE: {
......
^CMake Error at GENEX_EVAL-recursion2.cmake:8 \(add_custom_target\):
Error evaluating generator expression:
\$<GENEX_EVAL:\$<TARGET_PROPERTY:CUSTOM_PROPERTY1>>
\$<GENEX_EVAL:\$<TARGET_PROPERTY:CUSTOM_PROPERTY2>>
Dependency loop found.
Call Stack \(most recent call first\):
......@@ -11,7 +11,7 @@ Call Stack \(most recent call first\):
CMake Error at GENEX_EVAL-recursion2.cmake:8 \(add_custom_target\):
Loop step 1
\$<GENEX_EVAL:\$<TARGET_PROPERTY:CUSTOM_PROPERTY2>>
\$<GENEX_EVAL:\$<TARGET_PROPERTY:CUSTOM_PROPERTY1>>
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
......@@ -20,7 +20,7 @@ Call Stack \(most recent call first\):
CMake Error at GENEX_EVAL-recursion2.cmake:8 \(add_custom_target\):
Loop step 2
\$<TARGET_GENEX_EVAL:recursion,\$<TARGET_PROPERTY:recursion,CUSTOM_PROPERTY1>>
\$<GENEX_EVAL:\$<TARGET_PROPERTY:CUSTOM_PROPERTY2>>
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
......@@ -7,5 +7,6 @@ add_library (example SHARED empty.c)
set_property (TARGET example PROPERTY CUSTOM_PROPERTY1 "PROPERTY1")
set_property (TARGET example PROPERTY CUSTOM_PROPERTY2 "$<TARGET_PROPERTY:CUSTOM_PROPERTY1>")
set_property (TARGET example PROPERTY CUSTOM_PROPERTY3 "$<GENEX_EVAL:BEFORE_$<TARGET_PROPERTY:CUSTOM_PROPERTY2>_AFTER>")
set_property (TARGET example PROPERTY CUSTOM_PROPERTY4 "$<GENEX_EVAL:$<TARGET_PROPERTY:CUSTOM_PROPERTY3>>")
file(GENERATE OUTPUT "GENEX_EVAL-generated.txt" CONTENT "$<TARGET_GENEX_EVAL:example,$<TARGET_PROPERTY:example,CUSTOM_PROPERTY3>>")
file(GENERATE OUTPUT "GENEX_EVAL-generated.txt" CONTENT "$<TARGET_GENEX_EVAL:example,$<TARGET_PROPERTY:example,CUSTOM_PROPERTY4>>")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment