diff options
author | Brad King <brad.king@kitware.com> | 2014-07-02 13:54:50 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-07-02 13:54:50 (GMT) |
commit | 2ea0d6ba278e67f1fd6f2f78f2df9951a46eb4a4 (patch) | |
tree | 11045a52cf8ebb6ff2543c6443fc2d1d5710da3e /Source | |
parent | e2a12b8a58e0b96ef974463d4412fa804e3af297 (diff) | |
parent | 65aa5442b72aa8dda61088bdc0ffa2aa45965646 (diff) | |
download | CMake-2ea0d6ba278e67f1fd6f2f78f2df9951a46eb4a4.zip CMake-2ea0d6ba278e67f1fd6f2f78f2df9951a46eb4a4.tar.gz CMake-2ea0d6ba278e67f1fd6f2f78f2df9951a46eb4a4.tar.bz2 |
Merge topic 'fix-circular-transitive-properties-segfault'
65aa5442 Target: Return null when a transitive property is not defined.
61ce6547 Genex: Fix stack overflow in transitive property evaluation.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 13 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 30 |
2 files changed, 43 insertions, 0 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index c925869..b648eb2 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1028,6 +1028,19 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode { if (dagCheckerParent->EvaluatingLinkLibraries()) { +#define TRANSITIVE_PROPERTY_COMPARE(PROPERTY) \ + (#PROPERTY == propertyName || "INTERFACE_" #PROPERTY == propertyName) || + if (CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(TRANSITIVE_PROPERTY_COMPARE) + false) + { + 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(); + } +#undef TRANSITIVE_PROPERTY_COMPARE + if(!prop) { return std::string(); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index aa0ed56..d27293a 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3265,6 +3265,11 @@ const char *cmTarget::GetProperty(const std::string& prop, } if(prop == "INCLUDE_DIRECTORIES") { + if (this->Internal->IncludeDirectoriesEntries.empty()) + { + return 0; + } + static std::string output; output = ""; std::string sep; @@ -3283,6 +3288,11 @@ const char *cmTarget::GetProperty(const std::string& prop, } if(prop == "COMPILE_OPTIONS") { + if (this->Internal->CompileOptionsEntries.empty()) + { + return 0; + } + static std::string output; output = ""; std::string sep; @@ -3301,6 +3311,11 @@ const char *cmTarget::GetProperty(const std::string& prop, } if(prop == "COMPILE_FEATURES") { + if (this->Internal->CompileFeaturesEntries.empty()) + { + return 0; + } + static std::string output; output = ""; std::string sep; @@ -3319,6 +3334,11 @@ const char *cmTarget::GetProperty(const std::string& prop, } if(prop == "COMPILE_DEFINITIONS") { + if (this->Internal->CompileDefinitionsEntries.empty()) + { + return 0; + } + static std::string output; output = ""; std::string sep; @@ -3337,6 +3357,11 @@ const char *cmTarget::GetProperty(const std::string& prop, } if(prop == "LINK_LIBRARIES") { + if (this->Internal->LinkImplementationPropertyEntries.empty()) + { + return 0; + } + static std::string output; output = ""; std::string sep; @@ -3359,6 +3384,11 @@ const char *cmTarget::GetProperty(const std::string& prop, if(prop == "SOURCES") { + if (this->Internal->SourceEntries.empty()) + { + return 0; + } + cmOStringStream ss; const char* sep = ""; typedef cmTargetInternals::TargetPropertyEntry |