diff options
author | Stephen Kelly <steveire@gmail.com> | 2016-10-09 08:34:47 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2016-10-15 09:25:12 (GMT) |
commit | 425cd1670fdd40b752af71e5f28952ae4fcec4ac (patch) | |
tree | 5b5538f305e6636f94fa24000b8fb0874b35df43 /Source/cmMakefileLibraryTargetGenerator.cxx | |
parent | 0d818632978a450f1afaf687c867e62e885457f7 (diff) | |
download | CMake-425cd1670fdd40b752af71e5f28952ae4fcec4ac.zip CMake-425cd1670fdd40b752af71e5f28952ae4fcec4ac.tar.gz CMake-425cd1670fdd40b752af71e5f28952ae4fcec4ac.tar.bz2 |
cmLocalGenerator: Remove the launcher from RuleVariables
This one is not like the others as it doesn't participate in
substitutions. Keep ExpandRuleVariables doing only one thing and make
callers responsible for inserting a launcher prefix, simplifying the
code all-around.
Remove now-obsolete InsertRuleLauncher method.
Diffstat (limited to 'Source/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index a19d70e..5700c62 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -540,7 +540,6 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( vars.TargetVersionMajor = targetVersionMajor.c_str(); vars.TargetVersionMinor = targetVersionMinor.c_str(); - vars.RuleLauncher = "RULE_LAUNCH_LINK"; vars.CMTarget = this->GeneratorTarget; vars.Language = linkLanguage.c_str(); vars.Objects = buildObjs.c_str(); @@ -597,6 +596,14 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( vars.LanguageCompileFlags = langFlags.c_str(); + std::string launcher; + const char* val = this->LocalGenerator->GetRuleLauncher( + this->GeneratorTarget, "RULE_LAUNCH_LINK"); + if (val && *val) { + launcher = val; + launcher += " "; + } + // Construct the main link rule and expand placeholders. this->LocalGenerator->TargetImplib = targetOutPathImport; if (useArchiveRules) { @@ -611,7 +618,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( for (std::vector<std::string>::const_iterator i = archiveCreateCommands.begin(); i != archiveCreateCommands.end(); ++i) { - std::string cmd = *i; + std::string cmd = launcher + *i; this->LocalGenerator->ExpandRuleVariables(cmd, vars); real_link_commands.push_back(cmd); } @@ -622,7 +629,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( for (std::vector<std::string>::const_iterator i = archiveAppendCommands.begin(); i != archiveAppendCommands.end(); ++i) { - std::string cmd = *i; + std::string cmd = launcher + *i; this->LocalGenerator->ExpandRuleVariables(cmd, vars); real_link_commands.push_back(cmd); } @@ -632,7 +639,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( for (std::vector<std::string>::const_iterator i = archiveFinishCommands.begin(); i != archiveFinishCommands.end(); ++i) { - std::string cmd = *i; + std::string cmd = launcher + *i; this->LocalGenerator->ExpandRuleVariables(cmd, vars); // If there is no ranlib the command will be ":". Skip it. if (!cmd.empty() && cmd[0] != ':') { @@ -655,6 +662,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( // Expand placeholders. for (std::vector<std::string>::iterator i = real_link_commands.begin(); i != real_link_commands.end(); ++i) { + *i = launcher + *i; this->LocalGenerator->ExpandRuleVariables(*i, vars); } } |