summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-06-27 14:38:19 -0400
committerBrad King <brad.king@kitware.com>2016-06-27 14:38:19 -0400
commit76c66bf575a6c595b02bf241d03b74374857436a (patch)
treea30d644f21fe723b743c20a19903f6492fc12459
parentcd293886159e6130fb55cdbc3ef291ddb83883de (diff)
parent15b3f6f0f187ab12c29e437f737356bed13d977b (diff)
downloadcmake-76c66bf575a6c595b02bf241d03b74374857436a.tar.gz
Merge branch 'ninja-no-rsp-for-rc' into release
-rw-r--r--Source/cmNinjaTargetGenerator.cxx6
-rw-r--r--Tests/CMakeLists.txt3
-rw-r--r--Tests/VSResourceNinjaForceRSP/CMakeLists.txt7
-rw-r--r--Tests/VSResourceNinjaForceRSP/lib.cpp4
-rw-r--r--Tests/VSResourceNinjaForceRSP/main.cpp6
-rw-r--r--Tests/VSResourceNinjaForceRSP/test.rc4
6 files changed, 28 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(
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 2db5deda32..f21e430b7c 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -274,6 +274,9 @@ if(BUILD_TESTING)
endif()
if(TEST_RESOURCES)
ADD_TEST_MACRO(VSResource VSResource)
+ if (CMAKE_GENERATOR MATCHES "Ninja")
+ add_test_macro(VSResourceNinjaForceRSP VSResourceNinjaForceRSP)
+ endif ()
endif()
ADD_TEST_MACRO(MSManifest MSManifest)
ADD_TEST_MACRO(Simple Simple)
diff --git a/Tests/VSResourceNinjaForceRSP/CMakeLists.txt b/Tests/VSResourceNinjaForceRSP/CMakeLists.txt
new file mode 100644
index 0000000000..29ba0cee56
--- /dev/null
+++ b/Tests/VSResourceNinjaForceRSP/CMakeLists.txt
@@ -0,0 +1,7 @@
+cmake_minimum_required(VERSION 2.8.4)
+project(VSResourceNinjaForceRSP)
+
+set(CMAKE_NINJA_FORCE_RESPONSE_FILE TRUE)
+
+add_library(ResourceLib lib.cpp test.rc)
+add_executable(VSResourceNinjaForceRSP main.cpp test.rc)
diff --git a/Tests/VSResourceNinjaForceRSP/lib.cpp b/Tests/VSResourceNinjaForceRSP/lib.cpp
new file mode 100644
index 0000000000..c91239731b
--- /dev/null
+++ b/Tests/VSResourceNinjaForceRSP/lib.cpp
@@ -0,0 +1,4 @@
+int lib()
+{
+ return 0;
+}
diff --git a/Tests/VSResourceNinjaForceRSP/main.cpp b/Tests/VSResourceNinjaForceRSP/main.cpp
new file mode 100644
index 0000000000..247411d10f
--- /dev/null
+++ b/Tests/VSResourceNinjaForceRSP/main.cpp
@@ -0,0 +1,6 @@
+int main(int argc, char** argv)
+{
+ (void)argc;
+ (void)argv;
+ return 0;
+}
diff --git a/Tests/VSResourceNinjaForceRSP/test.rc b/Tests/VSResourceNinjaForceRSP/test.rc
new file mode 100644
index 0000000000..1ffade6ca8
--- /dev/null
+++ b/Tests/VSResourceNinjaForceRSP/test.rc
@@ -0,0 +1,4 @@
+STRINGTABLE
+BEGIN
+ 1234 "5"
+END