1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#!/bin/bash
# cmake accumulates CFLAGS from pkg-config, and then passes them to swiftc.
# One such argument is -pthread which swiftc cannot accommodate. Filter it out.
set -e
REAL_SWIFTC=
args=()
for arg in "$@"; do
case "$arg" in
"-mfpmath=sse") ;;
"-msse") ;;
"-msse2") ;;
"-pthread") ;;
"-Wl,"*)
ldarg="${arg#-Wl,}"
args+=("-Xlinker" "${ldarg//,/=}")
;;
*)
if [[ "$arg" == --original-swift-compiler=* ]]; then
REAL_SWIFTC="${arg#--original-swift-compiler=}"
else
args+=("$arg")
fi
;;
esac
done
exec "$REAL_SWIFTC" "${args[@]}"
|