diff options
author | Nils Gladitz <nilsgladitz@gmail.com> | 2017-06-23 08:58:39 (GMT) |
---|---|---|
committer | Nils Gladitz <nilsgladitz@gmail.com> | 2017-06-23 08:58:39 (GMT) |
commit | 5801751709974f873bc668d06b4020e92efe8cec (patch) | |
tree | 86299a67300e9fc12d26c56716ea4943463f92f0 /Source/cmNinjaNormalTargetGenerator.cxx | |
parent | 4c7caf15e4feef244f7e1772c1c932cc790e2cab (diff) | |
download | CMake-5801751709974f873bc668d06b4020e92efe8cec.zip CMake-5801751709974f873bc668d06b4020e92efe8cec.tar.gz CMake-5801751709974f873bc668d06b4020e92efe8cec.tar.bz2 |
Ninja: Fix generated command lines for cmake_symlink_* on Windows
CMake generates multiple commands cojoined with &&.
On Windows this only works when executing the commands through
the Windows shell.
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 14a4ef8..1e0bf8d 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -409,10 +409,14 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile) this->GetLocalGenerator()->ConvertToOutputFormat( cmSystemTools::GetCMakeCommand(), cmOutputConverter::SHELL); if (targetType == cmStateEnums::EXECUTABLE) { + std::vector<std::string> commandLines; + commandLines.push_back(cmakeCommand + + " -E cmake_symlink_executable $in $out"); + commandLines.push_back("$POST_BUILD"); + this->GetGlobalGenerator()->AddRule( "CMAKE_SYMLINK_EXECUTABLE", - cmakeCommand + " -E cmake_symlink_executable" - " $in $out && $POST_BUILD", + this->GetLocalGenerator()->BuildCommandLine(commandLines), "Creating executable symlink $out", "Rule for creating " "executable symlink.", /*depfile*/ "", @@ -422,10 +426,14 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile) /*restat*/ "", /*generator*/ false); } else { + std::vector<std::string> commandLines; + commandLines.push_back(cmakeCommand + + " -E cmake_symlink_library $in $SONAME $out"); + commandLines.push_back("$POST_BUILD"); + this->GetGlobalGenerator()->AddRule( "CMAKE_SYMLINK_LIBRARY", - cmakeCommand + " -E cmake_symlink_library" - " $in $SONAME $out && $POST_BUILD", + this->GetLocalGenerator()->BuildCommandLine(commandLines), "Creating library symlink $out", "Rule for creating " "library symlink.", /*depfile*/ "", |