diff options
author | Brad King <brad.king@kitware.com> | 2011-04-12 18:44:19 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2011-04-12 18:44:19 (GMT) |
commit | f3e48acad0151272a4f6202397160a3e74c70dda (patch) | |
tree | fc94b5d9233804ff0131c37aeb5859bf1f900d26 /Source | |
parent | 051a2200dadcfdcca72274c7f90bbae7dd6b946a (diff) | |
parent | 42a732ba2059255ac82a28fff3240c67955483e0 (diff) | |
download | CMake-f3e48acad0151272a4f6202397160a3e74c70dda.zip CMake-f3e48acad0151272a4f6202397160a3e74c70dda.tar.gz CMake-f3e48acad0151272a4f6202397160a3e74c70dda.tar.bz2 |
Merge topic 'windows-make-working-drive'
42a732b Change working drive only in MinGW Makefiles
b567613 Fix working drive of make rules on Windows
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index d1214d2..5c2cda1 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -2228,17 +2228,23 @@ void cmLocalUnixMakefileGenerator3 return; } + // In a Windows shell we must change drive letter too. The shell + // used by NMake and Borland make does not support "cd /d" so this + // feature simply cannot work with them (Borland make does not even + // support changing the drive letter with just "d:"). + const char* cd_cmd = this->MinGWMake? "cd /d " : "cd "; + if(!this->UnixCD) { // On Windows we must perform each step separately and then change // back because the shell keeps the working directory between // commands. - std::string cmd = "cd "; + std::string cmd = cd_cmd; cmd += this->ConvertToOutputForExisting(tgtDir, relRetDir); commands.insert(commands.begin(),cmd); // Change back to the starting directory. - cmd = "cd "; + cmd = cd_cmd; cmd += this->ConvertToOutputForExisting(relRetDir, tgtDir); commands.push_back(cmd); } @@ -2250,7 +2256,7 @@ void cmLocalUnixMakefileGenerator3 std::vector<std::string>::iterator i = commands.begin(); for (; i != commands.end(); ++i) { - std::string cmd = "cd "; + std::string cmd = cd_cmd; cmd += this->ConvertToOutputForExisting(tgtDir, relRetDir); cmd += " && "; cmd += *i; |