Ninja: sh needs something befor and after &&

This commit is contained in:
Peter Kuemmel 2012-06-14 16:20:49 +02:00
parent 1d55ea557d
commit eda3075478
1 changed files with 14 additions and 6 deletions

View File

@ -479,14 +479,13 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
if (targetOutput == targetOutputReal) { if (targetOutput == targetOutputReal) {
vars["POST_BUILD"] = postBuildCmdLine; vars["POST_BUILD"] = postBuildCmdLine;
if (preLinkCmdLines.empty()) {
// rule with PRE_LINK will be selected, feed it
vars["PRE_LINK"] = locGtor->nopCommand();
}
} else { } else {
vars["POST_BUILD"] = ":";
symlinkVars["POST_BUILD"] = postBuildCmdLine; symlinkVars["POST_BUILD"] = postBuildCmdLine;
} }
if (preLinkCmdLines.empty()) {
// rule with PRE_LINK will be selected, feed it
vars["PRE_LINK"] = locGtor->nopCommand();
}
} }
bool suppressShell = preLinkCmdLines.empty() && postBuildCmdLines.empty(); bool suppressShell = preLinkCmdLines.empty() && postBuildCmdLines.empty();
@ -496,7 +495,16 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
cmdLineLimit = 8000; cmdLineLimit = 8000;
#else #else
// cmdLineLimit = ?? TODO // cmdLineLimit = ?? TODO
suppressShell = true; suppressShell = false;
// TODO also use _NOSHELL rule
if (vars.find("PRE_LINK") == vars.end())
vars["PRE_LINK"] = locGtor->nopCommand();
if (vars.find("POST_BUILD") == vars.end())
vars["POST_BUILD"] = locGtor->nopCommand();
if (targetOutput != targetOutputReal &&
symlinkVars.find("POST_BUILD") == symlinkVars.end())
symlinkVars["POST_BUILD"] = locGtor->nopCommand();
#endif #endif
// Write the build statement for this target. // Write the build statement for this target.
cmGlobalNinjaGenerator::WriteBuild(this->GetBuildFileStream(), cmGlobalNinjaGenerator::WriteBuild(this->GetBuildFileStream(),