diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2022-08-07 16:31:51 +0200 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2022-08-13 14:42:52 +0200 |
commit | 9ca3b8b7cddcd44802cfb8377210a5ccf93184b6 (patch) | |
tree | 918e60dac5701d1ce147a46f864e4429b2833193 /compat/windows | |
parent | f85e0673c3a82acd2b267e934c6db3c9da154d86 (diff) |
compat: add msvc windres wrapper
This is by no means a complete wrapper. It's only designed to fit the
usecase ffmpegs build system has.
Diffstat (limited to 'compat/windows')
-rwxr-xr-x | compat/windows/mswindres | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/compat/windows/mswindres b/compat/windows/mswindres new file mode 100755 index 0000000000..450525a33e --- /dev/null +++ b/compat/windows/mswindres @@ -0,0 +1,32 @@ +#!/bin/sh + +if [ "$1" = "--version" ]; then + rc.exe /? + exit $? +fi + +if [ $# -lt 2 ]; then + echo "Usage: mswindres [-I/include/path ...] [-DSOME_DEFINE ...] [-o output.o] input.rc [output.o]" >&2 + exit 0 +fi + +EXTRA_OPTS="/nologo" + +while [ $# -gt 2 ]; do + case $1 in + -D*) EXTRA_OPTS="$EXTRA_OPTS /d$(echo $1 | sed -e "s/^..//" -e "s/ /\\\\ /g")" ;; + -I*) EXTRA_OPTS="$EXTRA_OPTS /i$(echo $1 | sed -e "s/^..//" -e "s/ /\\\\ /g")" ;; + -o) OPT_OUT="$2"; shift ;; + esac + shift +done + +IN="$1" +if [ -z "$OPT_OUT" ]; then + OUT="$2" +else + OUT="$OPT_OUT" +fi + +eval set -- $EXTRA_OPTS +rc.exe "$@" /fo "$OUT" "$IN" |