1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-07 11:13:41 +02:00
FFmpeg/compat/windows/mswindres
Ziemowit Laski f8d6d0fbf1 compat: Use '-' instead of '/' for rc.exe options
When building FFMPEG in the MSYS environment under Windows, one
must not use forward slashes ('/') for command-line options.  It
appears that the MSYS shell interprets these as absolute paths and
then automatically rewrites them into equivalent Windows paths.  For
example, the '/nologo' switch below gets rewritten to something like
'C:/Program Files/Git/nologo', and this obviously breaks the build.
Thankfully, most M$ tools accept dashes ('-') as well.

Signed-off-by: Ziemowit Łąski <15880281+zlaski@users.noreply.github.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-02-13 13:49:40 +02:00

33 lines
636 B
Bash
Executable File

#!/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"