summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorDmitry Ivanov <dmitry.ivanov@king.com>2016-04-06 10:55:15 (GMT)
committerBrad King <brad.king@kitware.com>2016-04-07 13:45:26 (GMT)
commit24c9106b7b2c3729985b89b06a2732ee3f555022 (patch)
treee4f99e83aca07a4f0a00226231fd899a142a17ee /Source
parent82c405c4737236ac0c954134d9cbc815823e2409 (diff)
downloadCMake-24c9106b7b2c3729985b89b06a2732ee3f555022.zip
CMake-24c9106b7b2c3729985b89b06a2732ee3f555022.tar.gz
CMake-24c9106b7b2c3729985b89b06a2732ee3f555022.tar.bz2
cmNinjaTargetGenerator: Factor out helper for forced response file check
Diffstat (limited to 'Source')
-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.