cmNinjaTargetGenerator: Factor out helper for forced response file check

This commit is contained in:
Dmitry Ivanov authored and Brad King committed 2016-04-07 09:45:26 -04:00
1 parent 82c405c473
commit 24c9106b7b
3 files changed
+10 -3

No files matched your search

+1 -3
View File
@@ -698,9 +698,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
cmGlobalNinjaGenerator& globalGen = *this->GetGlobalGenerator();
int commandLineLengthLimit = 1;
const char* forceRspFile = "CMAKE_NINJA_FORCE_RESPONSE_FILE";
if (!mf->IsDefinitionSet(forceRspFile) &&
cmSystemTools::GetEnv(forceRspFile) == 0)
if (!this->ForceResponseFile())
{
commandLineLengthLimit = calculateCommandLineLengthLimit(
globalGen.GetRuleCmdLength(this->LanguageLinkerRule()));
+7
View File
@@ -795,3 +795,10 @@ void cmNinjaTargetGenerator::addPoolNinjaVariable(
vars["pool"] = pool;
}
}
bool cmNinjaTargetGenerator::ForceResponseFile()
{
static std::string const forceRspFile = "CMAKE_NINJA_FORCE_RESPONSE_FILE";
return (this->GetMakefile()->IsDefinitionSet(forceRspFile) ||
cmSystemTools::GetEnv(forceRspFile) != 0);
}
+2
View File
@@ -152,6 +152,8 @@ protected:
cmGeneratorTarget* target,
cmNinjaVars& vars);
bool ForceResponseFile();
private:
cmLocalNinjaGenerator* LocalGenerator;
/// List of object files for this target.