summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2016-06-27 11:44:10 -0400
committerBrad King <brad.king@kitware.com>2016-06-27 14:34:06 -0400
commit15b3f6f0f187ab12c29e437f737356bed13d977b (patch)
tree98c85a59100e4b1462a049623af3ed3ea0256cd8 /Source
parentd152ae123d1a3df456fe24f2e1a06d97083ad2d2 (diff)
downloadcmake-15b3f6f0f187ab12c29e437f737356bed13d977b.tar.gz
ninja, rc: ignore CMAKE_NINJA_FORCE_RESPONSE_FILE for RC files
In commit v3.6.0-rc1~174^2 (Ninja: Honor CMAKE_NINJA_FORCE_RESPONSE_FILE for compile rules, 2016-04-06), Ninja learned to look for `CMAKE_NINJA_FORCE_RESPONSE_FILE` in the current scope or the environment in order to force response file usage for all compilation rules. However, on Windows, the RC compiler goes through cmcldeps which does a `replace(output, output + ".dep.obj")` on the command line. However, with a response file (which we name `output + ".rsp"`), the response file path is replaced instead causing the compiler to (correctly) complain that the response file `output + ".dep.obj.rsp"` does not exist. What needs to happen is for cmcldeps to look through the response file, replace *its* contents and place it in the `output + ".dep.obj.rsp"` file. Also add a test which actually compiles an RC file into a library and executable for all generators on Windows and additionally test `CMAKE_NINJA_FORCE_RESPONSE_FILE` for Ninja generators. Fixes #16167.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 1aa2ddb28d..bad5e2f0f8 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -316,7 +316,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
std::string rspcontent;
std::string responseFlag;
- if (this->ForceResponseFile()) {
+ if (lang != "RC" && this->ForceResponseFile()) {
rspfile = "$RSP_FILE";
responseFlag = "@" + rspfile;
rspcontent = " $DEFINES $INCLUDES $FLAGS";
@@ -593,7 +593,9 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
this->SetMsvcTargetPdbVariable(vars);
- int const commandLineLengthLimit = this->ForceResponseFile() ? -1 : 0;
+ bool const isRC = (language == "RC");
+ int const commandLineLengthLimit =
+ ((!isRC && this->ForceResponseFile())) ? -1 : 0;
std::string const rspfile = objectFileName + ".rsp";
this->GetGlobalGenerator()->WriteBuild(