Fix building only certain architectures when building on windows

On windows, we rename clang.exe to clang-$MAJOR.exe, and later
install clang.exe as a wrapper for the default architecture. But
if only building certain architectures, and the host architecture
isn't one of them, we shouldn't install any unprefixed clang.exe at
all.
This commit is contained in:
Martin Storsjö committed 2019-12-03 23:31:01 +02:00
1 parent 64d39428b6
commit af1099048a
3 files changed
+19 -9

No files matched your search

+13 -6
View File
@@ -94,10 +94,17 @@ if [ -n "$EXEEXT" ]; then
if [ -z "$HOST" ]; then
HOST=$(./clang-$CLANG_MAJOR -dumpmachine | sed 's/-.*//')-w64-mingw32
fi
for exec in clang clang++ gcc g++ cc c99 c11 c++ addr2line ar ranlib nm objcopy strings strip windres; do
ln -sf $HOST-$exec$EXEEXT $exec$EXEEXT
done
for exec in ld objdump dlltool; do
ln -sf $HOST-$exec $exec
done
HOST_ARCH="${HOST%%-*}"
# Install unprefixed wrappers if $HOST is one of the architectures
# we are installing wrappers for.
case $ARCHS in
*$HOST_ARCH*)
for exec in clang clang++ gcc g++ cc c99 c11 c++ addr2line ar ranlib nm objcopy strings strip windres; do
ln -sf $HOST-$exec$EXEEXT $exec$EXEEXT
done
for exec in ld objdump dlltool; do
ln -sf $HOST-$exec $exec
done
;;
esac
fi