summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2012-02-27 04:05:31 (GMT)
committerPeter Collingbourne <peter@pcc.me.uk>2012-02-27 04:05:38 (GMT)
commit80ff2102a41117fc829ad64c7c963bd0858a221b (patch)
tree4588d10520daab33ba3c8863b2811fb2aa9bfc7a /Source/cmNinjaTargetGenerator.cxx
parentd2731a376cce3044b507bfaf4427d89f0a03d2cf (diff)
downloadCMake-80ff2102a41117fc829ad64c7c963bd0858a221b.zip
CMake-80ff2102a41117fc829ad64c7c963bd0858a221b.tar.gz
CMake-80ff2102a41117fc829ad64c7c963bd0858a221b.tar.bz2
Ninja: Use cmSystemTools::ExpandListArgument to split compile/link commands
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index c776fcf..d0b4156 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -334,8 +334,15 @@ cmNinjaTargetGenerator
compileCmdVar += "_COMPILE_OBJECT";
std::string compileCmd =
this->GetMakefile()->GetRequiredDefinition(compileCmdVar.c_str());
+ std::vector<std::string> compileCmds;
+ cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
- this->GetLocalGenerator()->ExpandRuleVariables(compileCmd, vars);
+ for (std::vector<std::string>::iterator i = compileCmds.begin();
+ i != compileCmds.end(); ++i)
+ this->GetLocalGenerator()->ExpandRuleVariables(*i, vars);
+
+ std::string cmdLine =
+ this->GetLocalGenerator()->BuildCommandLine(compileCmds);
// Write the rule for compiling file of the given language.
std::ostringstream comment;
@@ -343,7 +350,7 @@ cmNinjaTargetGenerator
std::ostringstream description;
description << "Building " << language << " object $out";
this->GetGlobalGenerator()->AddRule(this->LanguageCompilerRule(language),
- compileCmd,
+ cmdLine,
description.str(),
comment.str(),
depfile);