diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-08-04 17:19:44 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-08-05 16:20:45 (GMT) |
commit | 97f10e488a5153e45d6a27a730cc1ecbaae7d559 (patch) | |
tree | 441d0aac1e278885a7841049aae61783391728ed | |
parent | 4b86f5edc91ba649908f5b6ab0fb7f1154e38066 (diff) | |
download | CMake-97f10e488a5153e45d6a27a730cc1ecbaae7d559.zip CMake-97f10e488a5153e45d6a27a730cc1ecbaae7d559.tar.gz CMake-97f10e488a5153e45d6a27a730cc1ecbaae7d559.tar.bz2 |
cmGeneratorTarget: Move ReportPropertyOrigin from cmTarget.
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 60 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.h | 7 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 40 | ||||
-rw-r--r-- | Source/cmTarget.h | 6 |
4 files changed, 57 insertions, 56 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index fe73fee..521a5b7 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -1937,24 +1937,24 @@ std::pair<bool, const char*> consistentProperty(const char *lhs, //---------------------------------------------------------------------------- template<typename PropertyType> -PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt, +PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt, const std::string &p, const std::string& config, const char *defaultValue, CompatibleType t, PropertyType *) { - PropertyType propContent = getTypedProperty<PropertyType>(tgt, p); - const bool explicitlySet = tgt->GetProperties() + PropertyType propContent = getTypedProperty<PropertyType>(tgt->Target, p); + const bool explicitlySet = tgt->Target->GetProperties() .find(p) - != tgt->GetProperties().end(); + != tgt->Target->GetProperties().end(); const bool impliedByUse = - tgt->IsNullImpliedByLinkLibraries(p); + tgt->Target->IsNullImpliedByLinkLibraries(p); assert((impliedByUse ^ explicitlySet) || (!impliedByUse && !explicitlySet)); std::vector<cmTarget const*> const& deps = - tgt->GetLinkImplementationClosure(config); + tgt->Target->GetLinkImplementationClosure(config); if(deps.empty()) { @@ -2125,7 +2125,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt, bool cmGeneratorTarget::GetLinkInterfaceDependentBoolProperty( const std::string &p, const std::string& config) const { - return checkInterfacePropertyCompatibility<bool>(this->Target, p, config, + return checkInterfacePropertyCompatibility<bool>(this, p, config, "FALSE", BoolType, 0); } @@ -2135,7 +2135,7 @@ const char* cmGeneratorTarget::GetLinkInterfaceDependentStringProperty( const std::string &p, const std::string& config) const { - return checkInterfacePropertyCompatibility<const char *>(this->Target, + return checkInterfacePropertyCompatibility<const char *>(this, p, config, "empty", @@ -2147,7 +2147,7 @@ const char * cmGeneratorTarget::GetLinkInterfaceDependentNumberMinProperty( const std::string &p, const std::string& config) const { - return checkInterfacePropertyCompatibility<const char *>(this->Target, + return checkInterfacePropertyCompatibility<const char *>(this, p, config, "empty", @@ -2159,7 +2159,7 @@ const char * cmGeneratorTarget::GetLinkInterfaceDependentNumberMaxProperty( const std::string &p, const std::string& config) const { - return checkInterfacePropertyCompatibility<const char *>(this->Target, + return checkInterfacePropertyCompatibility<const char *>(this, p, config, "empty", @@ -2196,3 +2196,43 @@ cmGeneratorTarget::GetLinkInformation(const std::string& config) const } return i->second; } + +//---------------------------------------------------------------------------- +void +cmGeneratorTarget::ReportPropertyOrigin(const std::string &p, + const std::string &result, + const std::string &report, + const std::string &compatibilityType) const +{ + std::vector<std::string> debugProperties; + const char *debugProp = this->Target->GetMakefile() + ->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES"); + if (debugProp) + { + cmSystemTools::ExpandListArgument(debugProp, debugProperties); + } + + bool debugOrigin = !this->DebugCompatiblePropertiesDone[p] + && std::find(debugProperties.begin(), + debugProperties.end(), + p) + != debugProperties.end(); + + if (this->Target->GetMakefile()->IsConfigured()) + { + this->DebugCompatiblePropertiesDone[p] = true; + } + if (!debugOrigin) + { + return; + } + + std::string areport = compatibilityType; + areport += std::string(" of property \"") + p + "\" for target \""; + areport += std::string(this->GetName()); + areport += "\" (result: \""; + areport += result; + areport += "\"):\n" + report; + + this->Makefile->GetCMakeInstance()->IssueMessage(cmake::LOG, areport); +} diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index d65b1ef..8e68d39 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -199,6 +199,11 @@ public: std::vector<cmSourceFile const*> XamlSources; }; + void ReportPropertyOrigin(const std::string &p, + const std::string &result, + const std::string &report, + const std::string &compatibilityType) const; + private: friend class cmTargetTraceDependencies; struct SourceEntry { std::vector<cmSourceFile*> Depends; }; @@ -212,6 +217,8 @@ private: mutable bool SourceFileFlagsConstructed; mutable std::map<cmSourceFile const*, SourceFileFlags> SourceFlagsMap; + mutable std::map<std::string, bool> DebugCompatiblePropertiesDone; + struct CompatibleInterfacesBase { std::set<std::string> PropsBool; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 1fa62e7..968bd9d 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -4537,46 +4537,6 @@ bool cmTarget::IsNullImpliedByLinkLibraries(const std::string &p) const //---------------------------------------------------------------------------- void -cmTarget::ReportPropertyOrigin(const std::string &p, - const std::string &result, - const std::string &report, - const std::string &compatibilityType) const -{ - std::vector<std::string> debugProperties; - const char *debugProp = - this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES"); - if (debugProp) - { - cmSystemTools::ExpandListArgument(debugProp, debugProperties); - } - - bool debugOrigin = !this->DebugCompatiblePropertiesDone[p] - && std::find(debugProperties.begin(), - debugProperties.end(), - p) - != debugProperties.end(); - - if (this->Makefile->IsConfigured()) - { - this->DebugCompatiblePropertiesDone[p] = true; - } - if (!debugOrigin) - { - return; - } - - std::string areport = compatibilityType; - areport += std::string(" of property \"") + p + "\" for target \""; - areport += std::string(this->GetName()); - areport += "\" (result: \""; - areport += result; - areport += "\"):\n" + report; - - this->Makefile->GetCMakeInstance()->IssueMessage(cmake::LOG, areport); -} - -//---------------------------------------------------------------------------- -void cmTarget::GetObjectLibrariesCMP0026(std::vector<cmTarget*>& objlibs) const { // At configure-time, this method can be called as part of getting the diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 795753e..85d9964 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -565,11 +565,6 @@ public: bool LinkLanguagePropagatesToDependents() const { return this->TargetTypeValue == STATIC_LIBRARY; } - void ReportPropertyOrigin(const std::string &p, - const std::string &result, - const std::string &report, - const std::string &compatibilityType) const; - std::map<std::string, std::string> const& GetMaxLanguageStandards() const { @@ -676,7 +671,6 @@ private: std::set<std::string> Utilities; mutable std::set<std::string> LinkImplicitNullProperties; std::map<std::string, cmListFileBacktrace> UtilityBacktraces; - mutable std::map<std::string, bool> DebugCompatiblePropertiesDone; mutable std::map<std::string, std::string> MaxLanguageStandards; cmPolicies::PolicyMap PolicyMap; std::string Name; |