windres: Remove the rc filtering in the wrapper shell script

llvm-rc does this filtering internally now.
This commit is contained in:
Martin Storsjö committed 2018-05-11 09:48:07 +03:00
1 parent da4d3df5da
commit ecdb6647b7
2 files changed
+2 -38

No files matched your search

+1 -2
View File
@@ -73,7 +73,6 @@ normal GCC/binutils based MinGW.
- The C++ exception unwinding in libunwind uses APIs that aren't available - The C++ exception unwinding in libunwind uses APIs that aren't available
in the UWP/WinRT API subset. in the UWP/WinRT API subset.
- The windres replacement, llvm-rc, isn't very mature and doesn't support - The windres replacement, llvm-rc, isn't very mature and doesn't support
everything that GNU windres does. Additionally, some part of the preprocessing everything that GNU windres does.
is currently implemented in shell script, making it a bit slow.
Additionally, one may run into other minor differences between GCC and clang. Additionally, one may run into other minor differences between GCC and clang.
+1 -36
View File
@@ -189,42 +189,7 @@ case "${INPUT_FORMAT}" in
# called with parameters like this: -DSTRING=\\\"1.2.3\\\" # 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" $CC -E $(echo $CPP_OPTIONS | sed 's/\\"/"/g') -xc -DRC_INVOKED=1 "${INPUT}" -o "${TMPDIR}/post.rc" || error "preprocessor failed"
# Parse the preprocessor output, looking for source file/line markers, llvm-rc $RC_OPTIONS "${TMPDIR}/post.rc" -c $CODEPAGE -fo "${TMPDIR}/in.res"
# and discard output from *.h files. This matches what rc.exe and binutils windres
# do.
IFS='
'
output=0
rm -f "${TMPDIR}/in.rc"
for line in $(cat "${TMPDIR}/post.rc"); do
case $line in
\#\ *|\#line\ *)
file="$(echo "$line" | awk '{print $3}' | sed 's/^"//;s/"$//')"
case $file in
*.h)
output=0
;;
*)
output=1
;;
esac
;;
\#*)
;;
*)
if [ $output -ne 0 ]; then
# Plain "echo" affects potential quotes and escapes in the
# content, with posix sh.
cat<<EOF >> "${TMPDIR}/in.rc"
$line
EOF
fi
;;
esac
done
unset IFS
llvm-rc $RC_OPTIONS "${TMPDIR}/in.rc" -c $CODEPAGE -fo "${TMPDIR}/in.res"
case "${OUTPUT_FORMAT}" in case "${OUTPUT_FORMAT}" in
"res") "res")
cat "${TMPDIR}/in.res" > "${OUTPUT}" cat "${TMPDIR}/in.res" > "${OUTPUT}"