Skip to content

llvm-rc: Restore include path for data after explicit preprocessing

Since !4219 (merged) with llvm-rc we explicitly preprocess RC source files and then compile separately without -I flags. This broke cases where the RC source references data files adjacent to itself or in the include path.

This change adds the expansion of the include paths when calling the llvm-rc in order for the resource files to be picked up correctly by llvm-rc. Since the RC compiled file is first preprocessed, the file being compiled by llvm-rc resides in the build directory. In order for llvm-rc to find the resource data specified relative to the .rc file being compiled, the source file path is preppended in the include list so that the original source path takes priority over all the other includes paths specified.

A space was added in the CMAKE_INCLUDE_FLAG_RC to make the include directive work properly for llvm-rc. Checks on the rc.exe showed that the syntax change doesn't affect it's proper operation.

Fixes: #20529 (closed)
Backport: release
Topic-rename: llvm-rc-include-path

Edited by Brad King

Merge request reports