Add wrappers that target Universal Windows

This commit is contained in:
Steve Lhomme authored and Martin Storsjö committed 2019-04-18 11:28:05 +03:00
1 parent 47acbb667e
commit ca44a11660
3 files changed
+37 -11

No files matched your search

+14 -11
View File
@@ -11,6 +11,7 @@ mkdir -p "$PREFIX"
PREFIX="$(cd "$PREFIX" && pwd)"
: ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
: ${TARGET_OSES:=${TOOLCHAIN_TARGET_OSES-mingw32 mingw32uwp}}
if [ -n "$HOST" ] && [ -z "$CC" ]; then
CC=$HOST-gcc
@@ -49,17 +50,19 @@ else
fi
cd $PREFIX/bin
for arch in $ARCHS; do
for exec in clang clang++ gcc g++ cc c99 c11 c++; do
ln -sf clang-target-wrapper$CTW_SUFFIX $arch-w64-mingw32-$exec$CTW_LINK_SUFFIX
done
for exec in ar ranlib nm objcopy strings strip; do
ln -sf llvm-$exec$EXEEXT $arch-w64-mingw32-$exec$EXEEXT || true
done
for exec in windres; do
ln -sf $exec-wrapper$EXEEXT $arch-w64-mingw32-$exec$EXEEXT
done
for exec in ld objdump dlltool; do
ln -sf $exec-wrapper.sh $arch-w64-mingw32-$exec
for target_os in $TARGET_OSES; do
for exec in clang clang++ gcc g++ cc c99 c11 c++; do
ln -sf clang-target-wrapper$CTW_SUFFIX $arch-w64-$target_os-$exec$CTW_LINK_SUFFIX
done
for exec in ar ranlib nm objcopy strings strip; do
ln -sf llvm-$exec$EXEEXT $arch-w64-$target_os-$exec$EXEEXT || true
done
for exec in windres; do
ln -sf $exec-wrapper$EXEEXT $arch-w64-$target_os-$exec$EXEEXT
done
for exec in ld objdump dlltool; do
ln -sf $exec-wrapper.sh $arch-w64-$target_os-$exec
done
done
done
if [ -n "$EXEEXT" ]; then
+12
View File
@@ -257,6 +257,9 @@ int _tmain(int argc, TCHAR* argv[]) {
dash = _tcschr(arch, '-');
if (dash)
*dash = '\0';
TCHAR *target_os = _tcsrchr(target, '-');
if (target_os)
target_os++;
// Check if trying to compile Ada; if we try to do this, invoking clang
// would end up invoking <triplet>-gcc with the same arguments, which ends
@@ -293,6 +296,15 @@ int _tmain(int argc, TCHAR* argv[]) {
// Dwarf is the default here.
}
if (target_os && !_tcscmp(target_os, _T("mingw32uwp"))) {
// the UWP target is for Windows 10
exec_argv[arg++] = _T("-D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00");
// the UWP target can only use Windows Store APIs
exec_argv[arg++] = _T("-DWINAPI_FAMILY=WINAPI_FAMILY_APP");
// the Windows Store API only supports Windows Unicode (some rare ANSI ones are available)
exec_argv[arg++] = _T("-DUNICODE");
}
exec_argv[arg++] = _T("-target");
exec_argv[arg++] = target;
exec_argv[arg++] = _T("-rtlib=compiler-rt");
+11
View File
@@ -8,6 +8,7 @@ if [ "$TARGET" = "$BASENAME" ]; then
TARGET=$DEFAULT_TARGET
fi
ARCH="${TARGET%%-*}"
TARGET_OS="${TARGET##*-}"
# Check if trying to compile Ada; if we try to do this, invoking clang
# would end up invoking <triplet>-gcc with the same arguments, which ends
@@ -52,6 +53,16 @@ aarch64)
# Dwarf is the default here.
;;
esac
case $TARGET_OS in
mingw32uwp)
# the UWP target is for Windows 10
FLAGS="$FLAGS -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00"
# the UWP target can only use Windows Store APIs
FLAGS="$FLAGS -DWINAPI_FAMILY=WINAPI_FAMILY_APP"
# the Windows Store API only supports Windows Unicode (some rare ANSI ones are available)
FLAGS="$FLAGS -DUNICODE"
;;
esac
FLAGS="$FLAGS -target $TARGET"
FLAGS="$FLAGS -rtlib=compiler-rt"