summaryrefslogtreecommitdiff
path: root/Modules/CMakeRCInformation.cmake
diff options
context:
space:
mode:
authorThomas Bernard <tbernard@go-engineering.de>2020-04-04 11:59:22 +0200
committerThomas Bernard <tbernard@go-engineering.de>2020-04-06 21:19:12 +0200
commit35a29ec82790890df4872e60943e9127e4603e54 (patch)
tree75f3ae21b74ba3d983a9ae1ed27f6cbd31a53025 /Modules/CMakeRCInformation.cmake
parent42cefc6bc174f0e6ec87f105b6bf0ca3d53eb2ee (diff)
downloadcmake-35a29ec82790890df4872e60943e9127e4603e54.tar.gz
llvm-rc: Restore include path for data after explicit preprocessing
Since commit 1c2d031cbd (Add -E cmake_llvm_rc to preprocess files for llvm-rc, 2020-01-14, v3.17.0-rc1~24^2) 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
Diffstat (limited to 'Modules/CMakeRCInformation.cmake')
-rw-r--r--Modules/CMakeRCInformation.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/CMakeRCInformation.cmake b/Modules/CMakeRCInformation.cmake
index 7c3a5ab30f..b634796b79 100644
--- a/Modules/CMakeRCInformation.cmake
+++ b/Modules/CMakeRCInformation.cmake
@@ -39,7 +39,7 @@ set(CMAKE_RC_FLAG_REGEX "^[-/](D|I)")
# now define the following rule variables
# CMAKE_RC_COMPILE_OBJECT
-set(CMAKE_INCLUDE_FLAG_RC "-I")
+set(CMAKE_INCLUDE_FLAG_RC "-I ")
# compile a Resource file into an object file
if(NOT CMAKE_RC_COMPILE_OBJECT)
set(CMAKE_RC_COMPILE_OBJECT