diff options
author | Ian Monroe <ian@hipchat.com> | 2013-04-18 10:57:39 -0700 |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2013-04-18 14:16:46 -0400 |
commit | e7c58f6c35d110a43c483a796fef644c6e22ce89 (patch) | |
tree | a454a631ccd3d27a4fc2e8499e7865c847f57a4b /Source/cmLocalNinjaGenerator.cxx | |
parent | 6a3ee5dd4e177c007459218612c45f9e6c9ec83b (diff) | |
download | cmake-e7c58f6c35d110a43c483a796fef644c6e22ce89.tar.gz |
Ninja: use cd /D to set directory on Windows
Add_custom_command was unable to handle build and source directories
existing on different drives.
Diffstat (limited to 'Source/cmLocalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmLocalNinjaGenerator.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index d902f4ef7a..294a539204 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -302,7 +302,12 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines(const cmCustomCommand *cc, wd = this->GetMakefile()->GetStartOutputDirectory(); cmOStringStream cdCmd; - cdCmd << "cd " << this->ConvertToOutputFormat(wd, SHELL); +#ifdef _WIN32 + std::string cdStr = "cd /D "; +#else + std::string cdStr = "cd "; +#endif + cdCmd << cdStr << this->ConvertToOutputFormat(wd, SHELL); cmdLines.push_back(cdCmd.str()); } for (unsigned i = 0; i != ccg.GetNumberOfCommands(); ++i) { |