diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 954c73e0d2ad8e4f5b2e06598a600efd483d42ec..4d469b232c52137d5c04ccd59f8ba5d6bc46fc15 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -321,7 +321,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";
@@ -603,7 +603,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 5911682403e0efa09b698edfeda4d5b8686ee745..b3d61bd1a0afae89cdfeba546a5c4c44369f7287 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 0000000000000000000000000000000000000000..29ba0cee56013204d16c1f06e765b771cf5bfa9d
--- /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 0000000000000000000000000000000000000000..c91239731bef3973c5171a7ac0cdeefde02c3ee3
--- /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 0000000000000000000000000000000000000000..247411d10f4d9cf563aa7e44925fd7c0008c2522
--- /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 0000000000000000000000000000000000000000..1ffade6ca8c70a373b83d6df3b1f75a8b188ddf8
--- /dev/null
+++ b/Tests/VSResourceNinjaForceRSP/test.rc
@@ -0,0 +1,4 @@
+STRINGTABLE
+BEGIN
+  1234 "5"
+END