summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
authorRuslan Baratov <ruslan_baratov@yahoo.com>2017-03-28 06:47:42 (GMT)
committerBrad King <brad.king@kitware.com>2017-03-30 18:56:52 (GMT)
commitdfa8263f4be4f1413b73c81649fdc4567a71e56a (patch)
tree23e540d2dcb39793a0f9ef503e392fb854beb985 /Source/cmNinjaNormalTargetGenerator.cxx
parent1588a577d16cfb1a689a444b1db1df3ccff2cc3d (diff)
downloadCMake-dfa8263f4be4f1413b73c81649fdc4567a71e56a.zip
CMake-dfa8263f4be4f1413b73c81649fdc4567a71e56a.tar.gz
CMake-dfa8263f4be4f1413b73c81649fdc4567a71e56a.tar.bz2
Implement interprocedural optimization for GNU compilers
Honor the `INTERPROCEDURAL_OPTIMIZATION` target property for GNU compilers by activating their link-time-optimization (LTO) flags.
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 5552fa9..eac3ecf 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -516,6 +516,10 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
std::string linkCmdVar = "CMAKE_";
linkCmdVar += this->TargetLinkLanguage;
linkCmdVar += "_ARCHIVE_CREATE";
+
+ linkCmdVar = this->GeneratorTarget->GetFeatureSpecificLinkRuleVariable(
+ linkCmdVar, this->GetConfigName());
+
const char* linkCmd = mf->GetRequiredDefinition(linkCmdVar);
cmSystemTools::ExpandListArgument(linkCmd, linkCmds);
}
@@ -523,6 +527,10 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
std::string linkCmdVar = "CMAKE_";
linkCmdVar += this->TargetLinkLanguage;
linkCmdVar += "_ARCHIVE_FINISH";
+
+ linkCmdVar = this->GeneratorTarget->GetFeatureSpecificLinkRuleVariable(
+ linkCmdVar, this->GetConfigName());
+
const char* linkCmd = mf->GetRequiredDefinition(linkCmdVar);
cmSystemTools::ExpandListArgument(linkCmd, linkCmds);
}