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.
Showing
- Source/cmNinjaTargetGenerator.cxx 4 additions, 2 deletionsSource/cmNinjaTargetGenerator.cxx
- Tests/CMakeLists.txt 3 additions, 0 deletionsTests/CMakeLists.txt
- Tests/VSResourceNinjaForceRSP/CMakeLists.txt 7 additions, 0 deletionsTests/VSResourceNinjaForceRSP/CMakeLists.txt
- Tests/VSResourceNinjaForceRSP/lib.cpp 4 additions, 0 deletionsTests/VSResourceNinjaForceRSP/lib.cpp
- Tests/VSResourceNinjaForceRSP/main.cpp 6 additions, 0 deletionsTests/VSResourceNinjaForceRSP/main.cpp
- Tests/VSResourceNinjaForceRSP/test.rc 4 additions, 0 deletionsTests/VSResourceNinjaForceRSP/test.rc
Loading
Please register or sign in to comment