summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx24
1 files changed, 19 insertions, 5 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index ec5ce9e..153c611 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -943,18 +943,32 @@ void cmGeneratorTarget::GetAppleArchs(const std::string& config,
}
//----------------------------------------------------------------------------
-const char* cmGeneratorTarget::GetCreateRuleVariable() const
+std::string
+cmGeneratorTarget::GetCreateRuleVariable(std::string const& lang,
+ std::string const& config) const
{
switch(this->GetType())
{
case cmTarget::STATIC_LIBRARY:
- return "_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 "_CREATE_SHARED_LIBRARY";
+ return "CMAKE_" + lang + "_CREATE_SHARED_LIBRARY";
case cmTarget::MODULE_LIBRARY:
- return "_CREATE_SHARED_MODULE";
+ return "CMAKE_" + lang + "_CREATE_SHARED_MODULE";
case cmTarget::EXECUTABLE:
- return "_LINK_EXECUTABLE";
+ return "CMAKE_" + lang + "_LINK_EXECUTABLE";
default:
break;
}