summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorIan Monroe <ian@hipchat.com>2013-04-18 17:57:39 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2013-04-18 18:16:46 (GMT)
commite7c58f6c35d110a43c483a796fef644c6e22ce89 (patch)
treea454a631ccd3d27a4fc2e8499e7865c847f57a4b /Source/cmLocalNinjaGenerator.cxx
parent6a3ee5dd4e177c007459218612c45f9e6c9ec83b (diff)
downloadCMake-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.cxx7
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) {