Implement interprocedural optimization for GNU compilers

Honor the `INTERPROCEDURAL_OPTIMIZATION` target property for GNU
compilers by activating their link-time-optimization (LTO) flags.
This commit is contained in:
Ruslan Baratov
2017-03-28 14:47:42 +08:00
committed by Brad King
parent 1588a577d1
commit dfa8263f4b
8 changed files with 103 additions and 14 deletions
+8
View File
@@ -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);
}