summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-08-04 17:19:42 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-08-05 16:20:44 (GMT)
commit244c5b5dcdc5af1f91a79a81f7f7ec4047759fe8 (patch)
treefa37b061fa4f1326fcef64c408bfaca96b35036f /Source/cmGeneratorTarget.cxx
parent12bc571c13eda8d504eac788d6b3e5e8d83e3ad3 (diff)
downloadCMake-244c5b5dcdc5af1f91a79a81f7f7ec4047759fe8.zip
CMake-244c5b5dcdc5af1f91a79a81f7f7ec4047759fe8.tar.gz
CMake-244c5b5dcdc5af1f91a79a81f7f7ec4047759fe8.tar.bz2
cmGeneratorTarget: Move IsLinkInterfaceDependent* from cmTarget.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx81
1 files changed, 81 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 95f6aaa..3dbeff2 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1436,3 +1436,84 @@ void cmGeneratorTarget::ConstructSourceFileFlags() const
}
}
}
+
+//----------------------------------------------------------------------------
+const cmGeneratorTarget::CompatibleInterfacesBase&
+cmGeneratorTarget::GetCompatibleInterfaces(std::string const& config) const
+{
+ cmGeneratorTarget::CompatibleInterfaces& compat =
+ this->CompatibleInterfacesMap[config];
+ if(!compat.Done)
+ {
+ compat.Done = true;
+ compat.PropsBool.insert("POSITION_INDEPENDENT_CODE");
+ compat.PropsString.insert("AUTOUIC_OPTIONS");
+ std::vector<cmTarget const*> const& deps =
+ this->Target->GetLinkImplementationClosure(config);
+ for(std::vector<cmTarget const*>::const_iterator li = deps.begin();
+ li != deps.end(); ++li)
+ {
+#define CM_READ_COMPATIBLE_INTERFACE(X, x) \
+ if(const char* prop = (*li)->GetProperty("COMPATIBLE_INTERFACE_" #X)) \
+ { \
+ std::vector<std::string> props; \
+ cmSystemTools::ExpandListArgument(prop, props); \
+ compat.Props##x.insert(props.begin(), props.end()); \
+ }
+ CM_READ_COMPATIBLE_INTERFACE(BOOL, Bool)
+ CM_READ_COMPATIBLE_INTERFACE(STRING, String)
+ CM_READ_COMPATIBLE_INTERFACE(NUMBER_MIN, NumberMin)
+ CM_READ_COMPATIBLE_INTERFACE(NUMBER_MAX, NumberMax)
+#undef CM_READ_COMPATIBLE_INTERFACE
+ }
+ }
+ return compat;
+}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::IsLinkInterfaceDependentBoolProperty(
+ const std::string &p, const std::string& config) const
+{
+ if (this->Target->GetType() == cmTarget::OBJECT_LIBRARY
+ || this->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
+ {
+ return false;
+ }
+ return this->GetCompatibleInterfaces(config).PropsBool.count(p) > 0;
+}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::IsLinkInterfaceDependentStringProperty(
+ const std::string &p, const std::string& config) const
+{
+ if (this->Target->GetType() == cmTarget::OBJECT_LIBRARY
+ || this->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
+ {
+ return false;
+ }
+ return this->GetCompatibleInterfaces(config).PropsString.count(p) > 0;
+}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMinProperty(
+ const std::string &p, const std::string& config) const
+{
+ if (this->Target->GetType() == cmTarget::OBJECT_LIBRARY
+ || this->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
+ {
+ return false;
+ }
+ return this->GetCompatibleInterfaces(config).PropsNumberMin.count(p) > 0;
+}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMaxProperty(
+ const std::string &p, const std::string& config) const
+{
+ if (this->Target->GetType() == cmTarget::OBJECT_LIBRARY
+ || this->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
+ {
+ return false;
+ }
+ return this->GetCompatibleInterfaces(config).PropsNumberMax.count(p) > 0;
+}