mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-04 13:19:51 -05:00
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.
This commit is contained in:
@@ -409,10 +409,14 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile)
|
|||||||
this->GetLocalGenerator()->ConvertToOutputFormat(
|
this->GetLocalGenerator()->ConvertToOutputFormat(
|
||||||
cmSystemTools::GetCMakeCommand(), cmOutputConverter::SHELL);
|
cmSystemTools::GetCMakeCommand(), cmOutputConverter::SHELL);
|
||||||
if (targetType == cmStateEnums::EXECUTABLE) {
|
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(
|
this->GetGlobalGenerator()->AddRule(
|
||||||
"CMAKE_SYMLINK_EXECUTABLE",
|
"CMAKE_SYMLINK_EXECUTABLE",
|
||||||
cmakeCommand + " -E cmake_symlink_executable"
|
this->GetLocalGenerator()->BuildCommandLine(commandLines),
|
||||||
" $in $out && $POST_BUILD",
|
|
||||||
"Creating executable symlink $out", "Rule for creating "
|
"Creating executable symlink $out", "Rule for creating "
|
||||||
"executable symlink.",
|
"executable symlink.",
|
||||||
/*depfile*/ "",
|
/*depfile*/ "",
|
||||||
@@ -422,10 +426,14 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile)
|
|||||||
/*restat*/ "",
|
/*restat*/ "",
|
||||||
/*generator*/ false);
|
/*generator*/ false);
|
||||||
} else {
|
} 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(
|
this->GetGlobalGenerator()->AddRule(
|
||||||
"CMAKE_SYMLINK_LIBRARY",
|
"CMAKE_SYMLINK_LIBRARY",
|
||||||
cmakeCommand + " -E cmake_symlink_library"
|
this->GetLocalGenerator()->BuildCommandLine(commandLines),
|
||||||
" $in $SONAME $out && $POST_BUILD",
|
|
||||||
"Creating library symlink $out", "Rule for creating "
|
"Creating library symlink $out", "Rule for creating "
|
||||||
"library symlink.",
|
"library symlink.",
|
||||||
/*depfile*/ "",
|
/*depfile*/ "",
|
||||||
|
|||||||
Reference in New Issue
Block a user