diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2016-06-27 15:44:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-06-27 18:34:06 (GMT) |
commit | 15b3f6f0f187ab12c29e437f737356bed13d977b (patch) | |
tree | 98c85a59100e4b1462a049623af3ed3ea0256cd8 /Tests/VSResourceNinjaForceRSP | |
parent | d152ae123d1a3df456fe24f2e1a06d97083ad2d2 (diff) | |
download | CMake-15b3f6f0f187ab12c29e437f737356bed13d977b.zip CMake-15b3f6f0f187ab12c29e437f737356bed13d977b.tar.gz CMake-15b3f6f0f187ab12c29e437f737356bed13d977b.tar.bz2 |
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 'Tests/VSResourceNinjaForceRSP')
-rw-r--r-- | Tests/VSResourceNinjaForceRSP/CMakeLists.txt | 7 | ||||
-rw-r--r-- | Tests/VSResourceNinjaForceRSP/lib.cpp | 4 | ||||
-rw-r--r-- | Tests/VSResourceNinjaForceRSP/main.cpp | 6 | ||||
-rw-r--r-- | Tests/VSResourceNinjaForceRSP/test.rc | 4 |
4 files changed, 21 insertions, 0 deletions
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 |