From cc2d414ea3ba73bba7b9fabf7ed3755e103add65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 10 May 2018 00:56:16 +0300 Subject: [PATCH] windres: Add the input file directory as include path This fixes building resource files that refer to external files relative to the source directory, without specifying any directory via include flags to windres itself. This is needed since llvm-rc doesn't see the original source file but only sees the preprocessed one in a temporary directory. Alternatively, the preprocessed file could be placed in the same directory as the source file, but when building e.g. outside of the source tree, writing files (even temporary ones) inside the source tree isn't generally expected. --- wrappers/windres-wrapper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrappers/windres-wrapper.sh b/wrappers/windres-wrapper.sh index d30baa4..c144068 100755 --- a/wrappers/windres-wrapper.sh +++ b/wrappers/windres-wrapper.sh @@ -189,7 +189,7 @@ case "${INPUT_FORMAT}" in # called with parameters like this: -DSTRING=\\\"1.2.3\\\" $CC -E $(echo $CPP_OPTIONS | sed 's/\\"/"/g') -xc -DRC_INVOKED=1 "${INPUT}" -o "${TMPDIR}/post.rc" || error "preprocessor failed" - llvm-rc $RC_OPTIONS "${TMPDIR}/post.rc" -c $CODEPAGE -fo "${TMPDIR}/in.res" + llvm-rc $RC_OPTIONS -I "$(dirname "${INPUT}")" "${TMPDIR}/post.rc" -c $CODEPAGE -fo "${TMPDIR}/in.res" case "${OUTPUT_FORMAT}" in "res") cat "${TMPDIR}/in.res" > "${OUTPUT}"