summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2012-02-19 03:07:09 (GMT)
committerPeter Collingbourne <peter@pcc.me.uk>2012-02-19 05:57:22 (GMT)
commit0643fee2fe92b7dccc4e63be7329f6da96f2e61f (patch)
tree7a3cc3909a3862fcb33dd5d37be81c83510da46a
parent43b1d8bad0cf78148e4d6e7b4013850731d5a824 (diff)
downloadCMake-0643fee2fe92b7dccc4e63be7329f6da96f2e61f.zip
CMake-0643fee2fe92b7dccc4e63be7329f6da96f2e61f.tar.gz
CMake-0643fee2fe92b7dccc4e63be7329f6da96f2e61f.tar.bz2
Ninja: Shell encode various CMake invocations
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx15
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx8
2 files changed, 17 insertions, 6 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index b1d8e5b..7c1529b 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -743,12 +743,19 @@ void cmGlobalNinjaGenerator::WriteTargetAll(std::ostream& os)
void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
{
- cmMakefile* mfRoot = this->LocalGenerators[0]->GetMakefile();
+ cmLocalGenerator *lg = this->LocalGenerators[0];
+ cmMakefile* mfRoot = lg->GetMakefile();
std::ostringstream cmd;
- cmd << mfRoot->GetRequiredDefinition("CMAKE_COMMAND")
- << " -H" << mfRoot->GetHomeDirectory()
- << " -B" << mfRoot->GetHomeOutputDirectory();
+ cmd << lg->ConvertToOutputFormat(
+ mfRoot->GetRequiredDefinition("CMAKE_COMMAND"),
+ cmLocalGenerator::SHELL)
+ << " -H"
+ << lg->ConvertToOutputFormat(mfRoot->GetHomeDirectory(),
+ cmLocalGenerator::SHELL)
+ << " -B"
+ << lg->ConvertToOutputFormat(mfRoot->GetHomeOutputDirectory(),
+ cmLocalGenerator::SHELL);
WriteRule(*this->RulesFileStream,
"RERUN_CMAKE",
cmd.str(),
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 4434aef..0174c3d 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -198,7 +198,9 @@ cmNinjaNormalTargetGenerator
if (this->TargetNameOut != this->TargetNameReal) {
std::string cmakeCommand =
- this->GetMakefile()->GetRequiredDefinition("CMAKE_COMMAND");
+ this->GetLocalGenerator()->ConvertToOutputFormat(
+ this->GetMakefile()->GetRequiredDefinition("CMAKE_COMMAND"),
+ cmLocalGenerator::SHELL);
if (targetType == cmTarget::EXECUTABLE)
this->GetGlobalGenerator()->AddRule("CMAKE_SYMLINK_EXECUTABLE",
cmakeCommand +
@@ -238,7 +240,9 @@ cmNinjaNormalTargetGenerator
// We have archive link commands set. First, delete the existing archive.
std::vector<std::string> linkCmds;
std::string cmakeCommand =
- this->GetMakefile()->GetRequiredDefinition("CMAKE_COMMAND");
+ this->GetLocalGenerator()->ConvertToOutputFormat(
+ this->GetMakefile()->GetRequiredDefinition("CMAKE_COMMAND"),
+ cmLocalGenerator::SHELL);
linkCmds.push_back(cmakeCommand + " -E remove $out");
// TODO: Use ARCHIVE_APPEND for archives over a certain size.