Attached Files | 0001-On-Windows-with-Ninja-use-cd-D-to-set-directory.patch [^] (1,186 bytes) 2013-04-18 14:03 [Show Content] [Hide Content]From 973ab4b26df0c885f4f65fb32a1b1349808dd62f Mon Sep 17 00:00:00 2001
From: Ian Monroe <ian@hipchat.com>
Date: Thu, 18 Apr 2013 10:57:39 -0700
Subject: [PATCH] On Windows with Ninja, use cd /D to set directory
/D is required to change drives.
previously add_custom_command was broken if the build directory
was a different drive than the source directory
---
Source/cmLocalNinjaGenerator.cxx | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
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) {
--
1.8.1.4
|