summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
authorPeter Kümmel <syntheticpp@gmx.net>2012-09-27 20:29:17 (GMT)
committerBrad King <brad.king@kitware.com>2012-10-01 21:06:38 (GMT)
commit1e47ccb5542954e1258affe36e0089f13618d23d (patch)
treee9d2b1c46ec732135149665fd5bd4511dc5584a7 /Source/cmNinjaNormalTargetGenerator.cxx
parente31df0393973e2995f4543890df31c2b752a8ee1 (diff)
downloadCMake-1e47ccb5542954e1258affe36e0089f13618d23d.zip
CMake-1e47ccb5542954e1258affe36e0089f13618d23d.tar.gz
CMake-1e47ccb5542954e1258affe36e0089f13618d23d.tar.bz2
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.
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index d42d7f6..6c54ced 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -554,10 +554,10 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
int linkRuleLength = this->GetGlobalGenerator()->
GetRuleCmdLength(this->LanguageLinkerRule());
- int commandLineLengthLimit;
- if (this->GetMakefile()->IsDefinitionSet("CMAKE_FORCE_RESPONSE_FILE")) {
- commandLineLengthLimit = 1;
- } else {
+ int commandLineLengthLimit = 1;
+ const char* forceRspFile = "CMAKE_NINJA_FORCE_RESPONSE_FILE";
+ if (!this->GetMakefile()->IsDefinitionSet(forceRspFile) &&
+ cmSystemTools::GetEnv(forceRspFile) == 0) {
#ifdef _WIN32
commandLineLengthLimit = 8000 - linkRuleLength;
#elif defined(__linux) || defined(__APPLE__)