summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx4
-rw-r--r--Source/cmNinjaTargetGenerator.cxx7
-rw-r--r--Source/cmNinjaTargetGenerator.h2
3 files changed, 10 insertions, 3 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index c34df3c..54cacef 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -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()));
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 5ff4fdb..87f0e3a 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -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);
+}
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index e3ec423..371bc3c 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -152,6 +152,8 @@ protected:
cmGeneratorTarget* target,
cmNinjaVars& vars);
+ bool ForceResponseFile();
+
private:
cmLocalNinjaGenerator* LocalGenerator;
/// List of object files for this target.