Ninja: also consider rule command length for rsp file
This commit is contained in:
parent
0c42faf63a
commit
6332ba5a58
|
@ -557,6 +557,8 @@ void cmGlobalNinjaGenerator::AddRule(const std::string& name,
|
|||
rspfile,
|
||||
restat,
|
||||
generator);
|
||||
|
||||
this->RuleCmdLength[name] = command.size();
|
||||
}
|
||||
|
||||
bool cmGlobalNinjaGenerator::HasRule(const std::string &name)
|
||||
|
|
|
@ -319,6 +319,8 @@ private:
|
|||
|
||||
std::string ninjaCmd() const;
|
||||
|
||||
int GetRuleCmdLength(const std::string& name) { return RuleCmdLength[name]; }
|
||||
|
||||
private:
|
||||
/// The file containing the build statement. (the relation ship of the
|
||||
/// compilation DAG).
|
||||
|
@ -335,6 +337,9 @@ private:
|
|||
/// The set of rules added to the generated build system.
|
||||
RulesSetType Rules;
|
||||
|
||||
/// Length of rule command, used by rsp file evaluation
|
||||
std::map<std::string, int> RuleCmdLength;
|
||||
|
||||
/// The set of dependencies to add to the "all" target.
|
||||
cmNinjaDeps AllDependencies;
|
||||
|
||||
|
|
|
@ -480,7 +480,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|||
|
||||
int cmdLineLimit;
|
||||
#ifdef _WIN32
|
||||
cmdLineLimit = 8000;
|
||||
cmdLineLimit = 8000 - this->GetGlobalGenerator()->
|
||||
GetRuleCmdLength(this->LanguageLinkerRule());
|
||||
#else
|
||||
cmdLineLimit = -1; // TODO
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue