Skip to content

Commit

Permalink
Add windres wrapper
Browse files Browse the repository at this point in the history
As is, the build calls windres/gcc instead of rc.exe/cvtres.exe.  We
add a minimalist wrapper to avoid that.  However, for some reason
`--escape` is passed to windres-options, what the wrapper can't handle,
so we disable in that script.
  • Loading branch information
cmb69 committed Nov 1, 2024
1 parent 880a1fa commit 18eade3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions source/build-aux/windres
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#! /bin/sh

OTHER_ARGS=()

while [[ $# -gt 0 ]]; do
case $1 in
-i)
INPUT="`cygpath -w $2`"
shift
shift
;;
--output-format=*)
if test "${1#*=}" != coff; then
echo "Unsupported output format ${1#*=}"
exit 1
fi
shift
;;
-o)
OUTPUT="`cygpath -w $2`"
shift
shift
;;
*)
OTHER_ARGS+=("$1")
shift
;;
esac
done

rc.exe ${OTHER_ARGS[@]} -fo ${OUTPUT}.res ${INPUT}
cvtres.exe -machine:${Platform} -out:${OUTPUT} ${OUTPUT}.res
rm ${OUTPUT}.res
2 changes: 1 addition & 1 deletion source/windows/windres-options
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

escape=
if test "$1" = "--escape"; then
escape=yes
escape=
shift
fi
version="$1" # something like 2.0 or 2.17 or 2.17.3 or 2.17.3-pre3
Expand Down

0 comments on commit 18eade3

Please sign in to comment.