diff options
author | Ian Monroe <ian@hipchat.com> | 2013-04-18 17:57:39 (GMT) |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2013-04-18 18:16:46 (GMT) |
commit | e7c58f6c35d110a43c483a796fef644c6e22ce89 (patch) | |
tree | a454a631ccd3d27a4fc2e8499e7865c847f57a4b /Source/cmLocalNinjaGenerator.cxx | |
parent | 6a3ee5dd4e177c007459218612c45f9e6c9ec83b (diff) | |
download | CMake-e7c58f6c35d110a43c483a796fef644c6e22ce89.zip CMake-e7c58f6c35d110a43c483a796fef644c6e22ce89.tar.gz CMake-e7c58f6c35d110a43c483a796fef644c6e22ce89.tar.bz2 |
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 d902f4e..294a539 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) { |