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.
This commit is contained in:
Martin Storsjö committed 2018-05-11 09:48:07 +03:00
1 parent ecdb6647b7
commit cc2d414ea3
1 file changed
+1 -1
+1 -1
View File
@@ -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}"