summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuslan Baratov <ruslan_baratov@yahoo.com>2017-03-28 06:06:05 (GMT)
committerBrad King <brad.king@kitware.com>2017-03-30 14:16:30 (GMT)
commita75757004bda0ff32a152a0d9d6379c02b1338ce (patch)
treecde26bb7f143fbd3358c7b7421070fbc0f7744e3
parente05835c35b5d31f31e1a55baf415c075b24a27ad (diff)
downloadCMake-a75757004bda0ff32a152a0d9d6379c02b1338ce.zip
CMake-a75757004bda0ff32a152a0d9d6379c02b1338ce.tar.gz
CMake-a75757004bda0ff32a152a0d9d6379c02b1338ce.tar.bz2
Refactoring: s,GetFeatureAsBool,IsIPOEnabled,
Method 'GetFeatureAsBool' is used only with 'INTERPROCEDURAL_OPTIMIZATION' feature. Substituting 'GetFeatureAsBool' with 'IsIPOEnabled'.
-rw-r--r--Source/cmCommonTargetGenerator.cxx7
-rw-r--r--Source/cmCommonTargetGenerator.h1
-rw-r--r--Source/cmGeneratorTarget.cxx6
-rw-r--r--Source/cmGeneratorTarget.h4
-rw-r--r--Source/cmLocalGenerator.cxx2
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx2
6 files changed, 8 insertions, 14 deletions
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index fd1ad36..fe2c0fe 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -43,18 +43,13 @@ const char* cmCommonTargetGenerator::GetFeature(const std::string& feature)
return this->GeneratorTarget->GetFeature(feature, this->ConfigName);
}
-bool cmCommonTargetGenerator::GetFeatureAsBool(const std::string& feature)
-{
- return this->GeneratorTarget->GetFeatureAsBool(feature, this->ConfigName);
-}
-
void cmCommonTargetGenerator::AddFeatureFlags(std::string& flags,
const std::string& lang)
{
// Add language-specific flags.
this->LocalGenerator->AddLanguageFlags(flags, lang, this->ConfigName);
- if (this->GetFeatureAsBool("INTERPROCEDURAL_OPTIMIZATION")) {
+ if (this->GeneratorTarget->IsIPOEnabled(this->ConfigName)) {
this->LocalGenerator->AppendFeatureOptions(flags, lang, "IPO");
}
}
diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h
index 8d68123..425ff91 100644
--- a/Source/cmCommonTargetGenerator.h
+++ b/Source/cmCommonTargetGenerator.h
@@ -32,7 +32,6 @@ protected:
// Feature query methods.
const char* GetFeature(const std::string& feature);
- bool GetFeatureAsBool(const std::string& feature);
// Helper to add flag for windows .def file.
void AddModuleDefinitionFlag(cmLinkLineComputer* linkLineComputer,
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index e27424f..2199e4a 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -656,9 +656,9 @@ const char* cmGeneratorTarget::GetFeature(const std::string& feature,
return this->LocalGenerator->GetFeature(feature, config);
}
-bool cmGeneratorTarget::GetFeatureAsBool(const std::string& feature,
- const std::string& config) const
+bool cmGeneratorTarget::IsIPOEnabled(const std::string& config) const
{
+ const char* feature = "INTERPROCEDURAL_OPTIMIZATION";
return cmSystemTools::IsOn(this->GetFeature(feature, config));
}
@@ -2416,7 +2416,7 @@ std::string cmGeneratorTarget::GetCreateRuleVariable(
switch (this->GetType()) {
case cmStateEnums::STATIC_LIBRARY: {
std::string var = "CMAKE_" + lang + "_CREATE_STATIC_LIBRARY";
- if (this->GetFeatureAsBool("INTERPROCEDURAL_OPTIMIZATION", config)) {
+ if (this->IsIPOEnabled(config)) {
std::string varIPO = var + "_IPO";
if (this->Makefile->GetDefinition(varIPO)) {
return varIPO;
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 68d6ef8..0ec7389 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -112,8 +112,8 @@ public:
const char* GetFeature(const std::string& feature,
const std::string& config) const;
- bool GetFeatureAsBool(const std::string& feature,
- const std::string& config) const;
+
+ bool IsIPOEnabled(const std::string& config) const;
bool IsLinkInterfaceDependentBoolProperty(const std::string& p,
const std::string& config) const;
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 82bf0b9..9333ed7 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1052,7 +1052,7 @@ void cmLocalGenerator::GetTargetCompileFlags(cmGeneratorTarget* target,
// Add language-specific flags.
this->AddLanguageFlags(flags, lang, config);
- if (target->GetFeatureAsBool("INTERPROCEDURAL_OPTIMIZATION", config)) {
+ if (target->IsIPOEnabled(config)) {
this->AppendFeatureOptions(flags, lang, "IPO");
}
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index e5fae13..9ce13ec 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -133,7 +133,7 @@ void cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules()
linkRuleVar += linkLanguage;
linkRuleVar += "_CREATE_STATIC_LIBRARY";
- if (this->GetFeatureAsBool("INTERPROCEDURAL_OPTIMIZATION") &&
+ if (this->GeneratorTarget->IsIPOEnabled(this->ConfigName) &&
this->Makefile->GetDefinition(linkRuleVar + "_IPO")) {
linkRuleVar += "_IPO";
}