diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2012-02-19 02:46:37 (GMT) |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2012-02-19 05:43:47 (GMT) |
commit | 43b1d8bad0cf78148e4d6e7b4013850731d5a824 (patch) | |
tree | ae8d8dc886b71df197dee31ac00dca7215b6e367 /Source/cmLocalNinjaGenerator.cxx | |
parent | cea03e632b71589592660614a63ff102ba923de8 (diff) | |
download | CMake-43b1d8bad0cf78148e4d6e7b4013850731d5a824.zip CMake-43b1d8bad0cf78148e4d6e7b4013850731d5a824.tar.gz CMake-43b1d8bad0cf78148e4d6e7b4013850731d5a824.tar.bz2 |
Ninja: Shell encode paths used in "cd" commands
Diffstat (limited to 'Source/cmLocalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmLocalNinjaGenerator.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 28e8d47..32f3833 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -325,12 +325,12 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines(const cmCustomCommand *cc, { cmCustomCommandGenerator ccg(*cc, this->GetConfigName(), this->Makefile); if (ccg.GetNumberOfCommands() > 0) { + const char* wd = cc->GetWorkingDirectory(); + if (!wd) + wd = this->GetMakefile()->GetStartOutputDirectory(); + std::ostringstream cdCmd; - cdCmd << "cd "; - if (const char* wd = cc->GetWorkingDirectory()) - cdCmd << wd; - else - cdCmd << this->GetMakefile()->GetStartOutputDirectory(); + cdCmd << "cd " << this->ConvertToOutputFormat(wd, SHELL); cmdLines.push_back(cdCmd.str()); } for (unsigned i = 0; i != ccg.GetNumberOfCommands(); ++i) { |