[Cmake-commits] CMake branch, next, updated. v3.6.0-rc3-556-g54294f3
Brad King
brad.king at kitware.com
Mon Jun 27 14:36:01 EDT 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 54294f3210cfafc502f8b7738a4ec42b69456483 (commit)
via 15b3f6f0f187ab12c29e437f737356bed13d977b (commit)
from 7bab8262928c5199710573c232f4fc51bc5688e7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=54294f3210cfafc502f8b7738a4ec42b69456483
commit 54294f3210cfafc502f8b7738a4ec42b69456483
Merge: 7bab826 15b3f6f
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Jun 27 14:36:00 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jun 27 14:36:00 2016 -0400
Merge topic 'find_package-duplicate-search-paths' into next
15b3f6f0 ninja, rc: ignore CMAKE_NINJA_FORCE_RESPONSE_FILE for RC files
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=15b3f6f0f187ab12c29e437f737356bed13d977b
commit 15b3f6f0f187ab12c29e437f737356bed13d977b
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Jun 27 11:44:10 2016 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Jun 27 14:34:06 2016 -0400
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.
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 1aa2ddb..bad5e2f 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 2db5ded..f21e430 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 0000000..29ba0ce
--- /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 0000000..c912397
--- /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 0000000..247411d
--- /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 0000000..1ffade6
--- /dev/null
+++ b/Tests/VSResourceNinjaForceRSP/test.rc
@@ -0,0 +1,4 @@
+STRINGTABLE
+BEGIN
+ 1234 "5"
+END
-----------------------------------------------------------------------
Summary of changes:
Source/cmNinjaTargetGenerator.cxx | 6 ++++--
Tests/CMakeLists.txt | 3 +++
Tests/VSResourceNinjaForceRSP/CMakeLists.txt | 7 +++++++
Tests/{VSResource => VSResourceNinjaForceRSP}/lib.cpp | 0
.../CompatibleInterface => VSResourceNinjaForceRSP}/main.cpp | 3 ++-
Tests/{VSResource/lib.rc => VSResourceNinjaForceRSP/test.rc} | 0
6 files changed, 16 insertions(+), 3 deletions(-)
create mode 100644 Tests/VSResourceNinjaForceRSP/CMakeLists.txt
copy Tests/{VSResource => VSResourceNinjaForceRSP}/lib.cpp (100%)
copy Tests/{RunCMake/CompatibleInterface => VSResourceNinjaForceRSP}/main.cpp (63%)
copy Tests/{VSResource/lib.rc => VSResourceNinjaForceRSP/test.rc} (100%)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list