summaryrefslogtreecommitdiff
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
authorNils Gladitz <nilsgladitz@gmail.com>2017-06-23 10:58:39 +0200
committerNils Gladitz <nilsgladitz@gmail.com>2017-06-23 10:58:39 +0200
commit5801751709974f873bc668d06b4020e92efe8cec (patch)
tree86299a67300e9fc12d26c56716ea4943463f92f0 /Source/cmNinjaNormalTargetGenerator.cxx
parent4c7caf15e4feef244f7e1772c1c932cc790e2cab (diff)
downloadcmake-5801751709974f873bc668d06b4020e92efe8cec.tar.gz
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.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 14a4ef8242..1e0bf8d90e 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*/ "",