summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionNode.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-07-20 23:29:13 (GMT)
committerBrad King <brad.king@kitware.com>2019-07-21 12:17:04 (GMT)
commit0239bf8ac88bb8ae9d8945be506cee2c9adb08f5 (patch)
treec7c874fe7b09b2ceb0c7ce47c41e4c5c7a0aac93 /Source/cmGeneratorExpressionNode.cxx
parent7caebeb0e4babc41e5c84b4ce0ea70adcfdea4a1 (diff)
downloadCMake-0239bf8ac88bb8ae9d8945be506cee2c9adb08f5.zip
CMake-0239bf8ac88bb8ae9d8945be506cee2c9adb08f5.tar.gz
CMake-0239bf8ac88bb8ae9d8945be506cee2c9adb08f5.tar.bz2
Genex: In TARGET_PROPERTY check for usage reqs in link libs earlier
Diffstat (limited to 'Source/cmGeneratorExpressionNode.cxx')
-rw-r--r--Source/cmGeneratorExpressionNode.cxx51
1 files changed, 26 insertions, 25 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index b027cd4..b268ea2 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1219,6 +1219,30 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
#undef POPULATE_INTERFACE_PROPERTY_NAME
+ bool evaluatingLinkLibraries = false;
+
+ if (dagCheckerParent) {
+ if (dagCheckerParent->EvaluatingGenexExpression() ||
+ dagCheckerParent->EvaluatingPICExpression()) {
+ // No check required.
+ } else if (dagCheckerParent->EvaluatingLinkLibraries()) {
+ evaluatingLinkLibraries = true;
+ if (!interfacePropertyName.empty()) {
+ reportError(
+ context, content->GetOriginalExpression(),
+ "$<TARGET_PROPERTY:...> expression in link libraries "
+ "evaluation depends on target property which is transitive "
+ "over the link libraries, creating a recursion.");
+ return std::string();
+ }
+ } else {
+#define ASSERT_TRANSITIVE_PROPERTY_METHOD(METHOD) dagCheckerParent->METHOD() ||
+ assert(CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(
+ ASSERT_TRANSITIVE_PROPERTY_METHOD) false); // NOLINT(clang-tidy)
+#undef ASSERT_TRANSITIVE_PROPERTY_METHOD
+ }
+ }
+
cmGeneratorExpressionDAGChecker dagChecker(
context->Backtrace, target, propertyName, content, dagCheckerParent);
@@ -1243,31 +1267,8 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
if (const char* p = target->GetProperty(propertyName)) {
result = p;
haveProp = true;
- }
-
- if (dagCheckerParent) {
- if (dagCheckerParent->EvaluatingGenexExpression() ||
- dagCheckerParent->EvaluatingPICExpression()) {
- // No check required.
- } else if (dagCheckerParent->EvaluatingLinkLibraries()) {
- if (!interfacePropertyName.empty()) {
- reportError(
- context, content->GetOriginalExpression(),
- "$<TARGET_PROPERTY:...> expression in link libraries "
- "evaluation depends on target property which is transitive "
- "over the link libraries, creating a recursion.");
- return std::string();
- }
-
- if (!haveProp) {
- return std::string();
- }
- } else {
-#define ASSERT_TRANSITIVE_PROPERTY_METHOD(METHOD) dagCheckerParent->METHOD() ||
- assert(CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(
- ASSERT_TRANSITIVE_PROPERTY_METHOD) false); // NOLINT(clang-tidy)
-#undef ASSERT_TRANSITIVE_PROPERTY_METHOD
- }
+ } else if (evaluatingLinkLibraries) {
+ return std::string();
}
if (!haveProp && !target->IsImported() &&