summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
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:29 (GMT)
commit7731e44f87ca9f70335f211a4ef64a1ea68c7f10 (patch)
tree3ac2942d31d313cf6dde8dc5a560b575ea038224 /Source/cmNinjaTargetGenerator.cxx
parentf9644a2d1b52fb566bdad9a7211a86a167d73859 (diff)
downloadCMake-7731e44f87ca9f70335f211a4ef64a1ea68c7f10.zip
CMake-7731e44f87ca9f70335f211a4ef64a1ea68c7f10.tar.gz
CMake-7731e44f87ca9f70335f211a4ef64a1ea68c7f10.tar.bz2
Ninja: Honor CMAKE_NINJA_FORCE_RESPONSE_FILE for compile rules
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx28
1 files changed, 24 insertions, 4 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 87f0e3a..753a5ae 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -341,11 +341,25 @@ cmNinjaTargetGenerator
cmMakefile* mf = this->GetMakefile();
+ std::string flags = "$FLAGS";
+ std::string rspfile;
+ std::string rspcontent;
+ std::string responseFlag;
+
+ if (this->ForceResponseFile())
+ {
+ rspfile = "$RSP_FILE";
+ responseFlag = "@" + rspfile;
+ rspcontent = " $DEFINES $INCLUDES $FLAGS";
+ flags = responseFlag;
+ vars.Defines = "";
+ vars.Includes = "";
+ }
+
// Tell ninja dependency format so all deps can be loaded into a database
std::string deptype;
std::string depfile;
std::string cldeps;
- std::string flags = "$FLAGS";
if (this->NeedDepTypeMSVC(lang))
{
deptype = "msvc";
@@ -460,8 +474,8 @@ cmNinjaTargetGenerator
comment.str(),
depfile,
deptype,
- /*rspfile*/ "",
- /*rspcontent*/ "",
+ rspfile,
+ rspcontent,
/*restat*/ "",
/*generator*/ false);
}
@@ -641,6 +655,9 @@ cmNinjaTargetGenerator
this->SetMsvcTargetPdbVariable(vars);
+ int const commandLineLengthLimit = this->ForceResponseFile() ? -1 : 0;
+ std::string const rspfile = objectFileName + ".rsp";
+
this->GetGlobalGenerator()->WriteBuild(this->GetBuildFileStream(),
comment,
rule,
@@ -648,7 +665,10 @@ cmNinjaTargetGenerator
explicitDeps,
implicitDeps,
orderOnlyDeps,
- vars);
+ vars,
+ rspfile,
+ commandLineLengthLimit);
+
if(const char* objectOutputs = source->GetProperty("OBJECT_OUTPUTS")) {
std::vector<std::string> outputList;