Support -S in cosmocross

You can now run commands like `x86_64-unknown-cosmo-c++ -S` when using
your cosmocc toolchain. Please note the S flag isn't supported for the
cosmocc command itself.
This commit is contained in:
Justine Tunney 2024-03-24 15:49:55 -07:00
parent 045632a743
commit 74a85087de
No known key found for this signature in database
GPG key ID: BE714B4575D6E328

View file

@ -122,6 +122,8 @@ for x; do
OPT=$x
elif [ x"$x" = x"-c" ]; then
INTENT=cc
elif [ x"$x" = x"-S" ]; then
INTENT=s
elif [ x"$x" = x"-s" ]; then
SFLAG=1
continue
@ -204,7 +206,7 @@ fi
if [ $INTENT = cpp ]; then
set -- "$CC" $PLATFORM $CPPFLAGS "$@"
elif [ $INTENT = cc ]; then
elif [ $INTENT = cc ] || [ $INTENT = s ]; then
set -- "$CC" $PLATFORM $PREDEF $CFLAGS $CPPFLAGS "$@" $PRECIOUS
else
set -- "$CC" $PLATFORM $PREDEF $CFLAGS $CPPFLAGS $CRT "$@" $LDFLAGS $LDLIBS $PRECIOUS