actions-rust-cross/set-cross-compile.sh
2023-03-05 12:54:11 -06:00

19 lines
459 B
Bash
Executable File

set -e
set -x
TARGET="$1"
# On macOS and Windows, we can cross-compile to all possible targets without
# using cross.
if uname -a | grep --quiet --extended-regexp -i "darwin|msys|windows"; then
echo "needs-cross=false" >> $GITHUB_OUTPUT
exit 0
fi
if echo "$TARGET" | grep --quiet --extended-regexp -i '(x86_64|586|686).+linux-(gnu|musl)'; then
echo "needs-cross=false" >> $GITHUB_OUTPUT
exit 0
fi
echo "needs-cross=true" >> $GITHUB_OUTPUT