Ninja: add option to enforce usage of response files
If the cmake or environment variable CMAKE_NINJA_FORCE_RESPONSE_FILE is set then a response file is used regardless the command line length.
This commit is contained in:
parent
e31df03939
commit
1e47ccb554
|
@ -554,10 +554,10 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
||||||
int linkRuleLength = this->GetGlobalGenerator()->
|
int linkRuleLength = this->GetGlobalGenerator()->
|
||||||
GetRuleCmdLength(this->LanguageLinkerRule());
|
GetRuleCmdLength(this->LanguageLinkerRule());
|
||||||
|
|
||||||
int commandLineLengthLimit;
|
int commandLineLengthLimit = 1;
|
||||||
if (this->GetMakefile()->IsDefinitionSet("CMAKE_FORCE_RESPONSE_FILE")) {
|
const char* forceRspFile = "CMAKE_NINJA_FORCE_RESPONSE_FILE";
|
||||||
commandLineLengthLimit = 1;
|
if (!this->GetMakefile()->IsDefinitionSet(forceRspFile) &&
|
||||||
} else {
|
cmSystemTools::GetEnv(forceRspFile) == 0) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
commandLineLengthLimit = 8000 - linkRuleLength;
|
commandLineLengthLimit = 8000 - linkRuleLength;
|
||||||
#elif defined(__linux) || defined(__APPLE__)
|
#elif defined(__linux) || defined(__APPLE__)
|
||||||
|
|
Loading…
Reference in New Issue