Skip to content

ninja, rc: ignore CMAKE_NINJA_FORCE_RESPONSE_FILE for RC files

In commit 7731e44f, 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 (closed).

Merge request reports