diff options
author | Brad King <brad.king@kitware.com> | 2019-05-23 13:22:25 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-05-23 13:22:37 (GMT) |
commit | f03a80aefd4073bc1502c2e486fedfdbd8addfb6 (patch) | |
tree | 480503316d058e68c009be397034c60782c74a83 /Source | |
parent | a4faf7788cc40b17c48a9393cd15425ee65abfd9 (diff) | |
parent | 5a1af142f120ccc6834efcf786e346b06e0f05c6 (diff) | |
download | CMake-f03a80aefd4073bc1502c2e486fedfdbd8addfb6.zip CMake-f03a80aefd4073bc1502c2e486fedfdbd8addfb6.tar.gz CMake-f03a80aefd4073bc1502c2e486fedfdbd8addfb6.tar.bz2 |
Merge topic 'genex-target-property-lifetime'
5a1af142f1 Genex: Fix value lifetimes in nested TARGET_PROPERTY evaluation
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3362
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGeneratorExpressionNode.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 709355a..68ef170 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -1215,7 +1215,12 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode break; } - const char* prop = target->GetProperty(propertyName); + std::string prop; + bool haveProp = false; + if (const char* p = target->GetProperty(propertyName)) { + prop = p; + haveProp = true; + } if (dagCheckerParent) { if (dagCheckerParent->EvaluatingGenexExpression() || @@ -1235,7 +1240,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode } #undef TRANSITIVE_PROPERTY_COMPARE - if (!prop) { + if (!haveProp) { return std::string(); } } else { @@ -1291,7 +1296,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode } } - if (!prop) { + if (!haveProp) { if (target->IsImported() || target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { return linkedTargetsContent; |