diff options
Diffstat (limited to 'Source/cmMakefileExecutableTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index ed34ce6..7eca0a8 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -11,6 +11,7 @@ #include "cmMakefile.h" #include "cmOSXBundleGenerator.h" #include "cmOutputConverter.h" +#include "cmRulePlaceholderExpander.h" #include "cmSystemTools.h" #include "cmake.h" @@ -331,9 +332,10 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) std::string manifests = this->GetManifests(); - cmLocalGenerator::RuleVariables vars; - vars.RuleLauncher = "RULE_LAUNCH_LINK"; - vars.CMTarget = this->GeneratorTarget; + cmRulePlaceholderExpander::RuleVariables vars; + vars.CMTargetName = this->GeneratorTarget->GetName().c_str(); + vars.CMTargetType = + cmState::GetTargetTypeName(this->GeneratorTarget->GetType()); vars.Language = linkLanguage.c_str(); vars.Objects = buildObjs.c_str(); std::string objectDir = this->GeneratorTarget->GetSupportDirectory(); @@ -383,13 +385,26 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) real_link_commands.push_back(cmakeCommand); } + std::string launcher; + + const char* val = this->LocalGenerator->GetRuleLauncher( + this->GeneratorTarget, "RULE_LAUNCH_LINK"); + if (val && *val) { + launcher = val; + launcher += " "; + } + + CM_AUTO_PTR<cmRulePlaceholderExpander> rulePlaceholderExpander( + this->LocalGenerator->CreateRulePlaceholderExpander()); + // Expand placeholders in the commands. - this->LocalGenerator->TargetImplib = targetOutPathImport; + rulePlaceholderExpander->SetTargetImpLib(targetOutPathImport); for (std::vector<std::string>::iterator i = real_link_commands.begin(); i != real_link_commands.end(); ++i) { - this->LocalGenerator->ExpandRuleVariables(*i, vars); + *i = launcher + *i; + rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, *i, + vars); } - this->LocalGenerator->TargetImplib = ""; // Restore path conversion to normal shells. this->LocalGenerator->SetLinkScriptShell(false); |