Ninja: be more accurate when estimating the command line length
This commit is contained in:
parent
f13a6a087e
commit
41c28dc35b
@ -177,7 +177,8 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
|
|||||||
|
|
||||||
// check if a response file rule should be used
|
// check if a response file rule should be used
|
||||||
const std::string args = arguments.str();
|
const std::string args = arguments.str();
|
||||||
if (cmdLineLimit > 0 && args.size() > (size_t)cmdLineLimit)
|
if (cmdLineLimit > 0 &&
|
||||||
|
(args.size() + + builds.str().size()) > (size_t)cmdLineLimit)
|
||||||
builds << "_RSPFILE";
|
builds << "_RSPFILE";
|
||||||
|
|
||||||
os << builds.str() << args;
|
os << builds.str() << args;
|
||||||
|
@ -478,12 +478,13 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|||||||
symlinkVars["POST_BUILD"] = postBuildCmdLine;
|
symlinkVars["POST_BUILD"] = postBuildCmdLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmdLineLimit = -1;
|
int cmdLineLimit;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
cmdLineLimit = 8100;
|
cmdLineLimit = 8000;
|
||||||
#else
|
#else
|
||||||
// TODO
|
cmdLineLimit = -1; // TODO
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Write the build statement for this target.
|
// Write the build statement for this target.
|
||||||
cmGlobalNinjaGenerator::WriteBuild(this->GetBuildFileStream(),
|
cmGlobalNinjaGenerator::WriteBuild(this->GetBuildFileStream(),
|
||||||
comment.str(),
|
comment.str(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user