summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-06-08 17:54:05 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-06-08 17:54:05 (GMT)
commitf5690cc57c0cd18ee8619332379f523c8fac46a1 (patch)
tree6b93d19bf93e344ee3a18b6d9941adbc3bd2331f /Source/cmGeneratorTarget.cxx
parentd18852d5961584125ae113fae23f4b55a760e159 (diff)
parentf573bd22e4049746b53789fc0502cff8423dbe56 (diff)
downloadCMake-f5690cc57c0cd18ee8619332379f523c8fac46a1.zip
CMake-f5690cc57c0cd18ee8619332379f523c8fac46a1.tar.gz
CMake-f5690cc57c0cd18ee8619332379f523c8fac46a1.tar.bz2
Merge topic 'move-Feature-API'
f573bd22 cmLocalGenerator: Add Feature API from cmMakefile. ccbc2259 cmGeneratorTarget: Move Feature API from cmTarget.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx30
1 files changed, 29 insertions, 1 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index e2b8c45..67d0d54 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -353,6 +353,34 @@ void cmGeneratorTarget::ComputeObjectMapping()
}
//----------------------------------------------------------------------------
+const char* cmGeneratorTarget::GetFeature(const std::string& feature,
+ const std::string& config) const
+{
+ if(!config.empty())
+ {
+ std::string featureConfig = feature;
+ featureConfig += "_";
+ featureConfig += cmSystemTools::UpperCase(config);
+ if(const char* value = this->Target->GetProperty(featureConfig))
+ {
+ return value;
+ }
+ }
+ if(const char* value = this->Target->GetProperty(feature))
+ {
+ return value;
+ }
+ return this->LocalGenerator->GetFeature(feature, config);
+}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::GetFeatureAsBool(const std::string& feature,
+ const std::string& config) const
+{
+ return cmSystemTools::IsOn(this->GetFeature(feature, config));
+}
+
+//----------------------------------------------------------------------------
const std::string& cmGeneratorTarget::GetObjectName(cmSourceFile const* file)
{
this->ComputeObjectMapping();
@@ -983,7 +1011,7 @@ cmGeneratorTarget::GetCreateRuleVariable(std::string const& lang,
case cmTarget::STATIC_LIBRARY:
{
std::string var = "CMAKE_" + lang + "_CREATE_STATIC_LIBRARY";
- if(this->Target->GetFeatureAsBool(
+ if(this->GetFeatureAsBool(
"INTERPROCEDURAL_OPTIMIZATION", config))
{
std::string varIPO = var + "_IPO";