summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileLibraryTargetGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-10-09 08:34:50 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-10-15 09:25:12 (GMT)
commitb59b6dd9d27de7839c7b23a3094db33298038896 (patch)
tree2b36fbb568918ef952f0f59beaa15363f09b400f /Source/cmMakefileLibraryTargetGenerator.cxx
parentbdddd4234e977f65ee7df8adcd3888706dfd0dda (diff)
downloadCMake-b59b6dd9d27de7839c7b23a3094db33298038896.zip
CMake-b59b6dd9d27de7839c7b23a3094db33298038896.tar.gz
CMake-b59b6dd9d27de7839c7b23a3094db33298038896.tar.bz2
cmRulePlaceholderExpander: Port clients to direct-use
Add a factory function to cmLocalGenerator so that variableMappings can be provided from it, and so that Ninja can always have a hard-coded TargetImpLib.
Diffstat (limited to 'Source/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx24
1 files changed, 13 insertions, 11 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 1ae34d6..00a9100 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -11,6 +11,7 @@
#include "cmMakefile.h"
#include "cmOSXBundleGenerator.h"
#include "cmOutputConverter.h"
+#include "cmRulePlaceholderExpander.h"
#include "cmState.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -520,7 +521,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
std::string manifests = this->GetManifests();
- cmLocalGenerator::RuleVariables vars;
+ cmRulePlaceholderExpander::RuleVariables vars;
vars.TargetPDB = targetOutPathPDB.c_str();
// Setup the target version.
@@ -606,8 +607,10 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
launcher += " ";
}
+ CM_AUTO_PTR<cmRulePlaceholderExpander> rulePlaceholderExpander(
+ this->LocalGenerator->CreateRulePlaceholderExpander());
// Construct the main link rule and expand placeholders.
- this->LocalGenerator->TargetImplib = targetOutPathImport;
+ rulePlaceholderExpander->SetTargetImpLib(targetOutPathImport);
if (useArchiveRules) {
// Construct the individual object list strings.
std::vector<std::string> object_strings;
@@ -621,8 +624,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
archiveCreateCommands.begin();
i != archiveCreateCommands.end(); ++i) {
std::string cmd = launcher + *i;
- this->LocalGenerator->ExpandRuleVariables(this->LocalGenerator, cmd,
- vars);
+ rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator,
+ cmd, vars);
real_link_commands.push_back(cmd);
}
}
@@ -633,8 +636,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
archiveAppendCommands.begin();
i != archiveAppendCommands.end(); ++i) {
std::string cmd = launcher + *i;
- this->LocalGenerator->ExpandRuleVariables(this->LocalGenerator, cmd,
- vars);
+ rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator,
+ cmd, vars);
real_link_commands.push_back(cmd);
}
}
@@ -644,8 +647,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
archiveFinishCommands.begin();
i != archiveFinishCommands.end(); ++i) {
std::string cmd = launcher + *i;
- this->LocalGenerator->ExpandRuleVariables(this->LocalGenerator, cmd,
- vars);
+ rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, cmd,
+ vars);
// If there is no ranlib the command will be ":". Skip it.
if (!cmd.empty() && cmd[0] != ':') {
real_link_commands.push_back(cmd);
@@ -668,11 +671,10 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
for (std::vector<std::string>::iterator i = real_link_commands.begin();
i != real_link_commands.end(); ++i) {
*i = launcher + *i;
- this->LocalGenerator->ExpandRuleVariables(this->LocalGenerator, *i,
- vars);
+ rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, *i,
+ vars);
}
}
- this->LocalGenerator->TargetImplib = "";
// Restore path conversion to normal shells.
this->LocalGenerator->SetLinkScriptShell(false);