summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-05-21 13:40:30 (GMT)
committerBrad King <brad.king@kitware.com>2014-05-21 13:49:14 (GMT)
commitb6e2e0d194c41cfff7dc8677dd411d5ea061602b (patch)
tree372473207d0ee2b7610dde028a8aeb2d91eeed15 /Source/cmGeneratorTarget.cxx
parent5d12b87b9d505b8c9d0d4363e33636078c7510e7 (diff)
downloadCMake-b6e2e0d194c41cfff7dc8677dd411d5ea061602b.zip
CMake-b6e2e0d194c41cfff7dc8677dd411d5ea061602b.tar.gz
CMake-b6e2e0d194c41cfff7dc8677dd411d5ea061602b.tar.bz2
Ninja: Fix Intel interprocedural optimization with static libraries
Teach cmGeneratorTarget::GetCreateRuleVariable about the IPO variant. Return the static library IPO rule when the feature is enabled.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 20f2d96..153c611 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -945,12 +945,24 @@ void cmGeneratorTarget::GetAppleArchs(const std::string& config,
//----------------------------------------------------------------------------
std::string
cmGeneratorTarget::GetCreateRuleVariable(std::string const& lang,
- std::string const&) const
+ std::string const& config) const
{
switch(this->GetType())
{
case cmTarget::STATIC_LIBRARY:
- return "CMAKE_" + lang + "_CREATE_STATIC_LIBRARY";
+ {
+ std::string var = "CMAKE_" + lang + "_CREATE_STATIC_LIBRARY";
+ if(this->Target->GetFeatureAsBool(
+ "INTERPROCEDURAL_OPTIMIZATION", config))
+ {
+ std::string varIPO = var + "_IPO";
+ if(this->Makefile->GetDefinition(varIPO))
+ {
+ return varIPO;
+ }
+ }
+ return var;
+ }
case cmTarget::SHARED_LIBRARY:
return "CMAKE_" + lang + "_CREATE_SHARED_LIBRARY";
case cmTarget::MODULE_LIBRARY: