builder: mingw 32 bit updates.

Fix cross building glib with meson for 32 bit Windows, set cpu_family
correctly in the cross file.

Do not build ffmpeg for 32 bit Windows because it is not compatible with
Windows XP and it's better to have a smaller 32 bit binary.

Turn off LTO for 32 bit Windows because it is now broken too, in a
different way than for 64 bit Windows.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2019-12-19 02:57:03 +00:00
parent b57bd76e3a
commit 17d2fbc5cc
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
2 changed files with 14 additions and 7 deletions

View File

@ -210,7 +210,6 @@ DISTS=$DISTS'
ffmpeg https://ffmpeg.org/releases/ffmpeg-4.2.1.tar.bz2 lib/libavformat.a ffmpeg https://ffmpeg.org/releases/ffmpeg-4.2.1.tar.bz2 lib/libavformat.a
' '
# for now we don't build ffmpeg because game recording is broken
BUILD_FFMPEG=1 BUILD_FFMPEG=1
FFMPEG_DISTS=' FFMPEG_DISTS='
@ -479,6 +478,9 @@ pre_build_all() {
setup() { setup() {
detect_os detect_os
target_os=${CROSS_OS:-$os}
target_bits=${target_bits:-$bits}
mkdir -p "$BUILD_ROOT/tmp" mkdir -p "$BUILD_ROOT/tmp"
rm -rf "$BUILD_ROOT/tmp/"* rm -rf "$BUILD_ROOT/tmp/"*
@ -506,6 +508,12 @@ setup() {
cd "$OPWD" cd "$OPWD"
# Don't use ffmpeg for 32 bit windows builds for XP compat and to make the
# binary smaller.
if [ "$target_os" = windows ] && [ "$target_bits" -eq 32 ]; then
BUILD_FFMPEG=
fi
if [ -z "$BUILD_FFMPEG" ]; then if [ -z "$BUILD_FFMPEG" ]; then
for dist in $FFMPEG_DISTS; do for dist in $FFMPEG_DISTS; do
table_line_remove DISTS $dist table_line_remove DISTS $dist
@ -2636,9 +2644,6 @@ die() {
build_project() { build_project() {
puts "${NL}Building project: $CHECKOUT${NL}${NL}" puts "${NL}Building project: $CHECKOUT${NL}${NL}"
target_os=${CROSS_OS:-$os}
target_bits=${target_bits:-$bits}
dist_pre_build project dist_pre_build project
mkdir -p "$BUILD_ROOT/project" mkdir -p "$BUILD_ROOT/project"
@ -2648,8 +2653,8 @@ build_project() {
lto=ON lto=ON
# FIXME: LTO still broken on 64 bit mingw # FIXME: LTO still broken on 64 bit mingw, and now 32 bit mingw too
if [ "$target_os" = windows ] && [ "$target_bits" = 64 ]; then if [ "$target_os" = windows ]; then
lto=OFF lto=OFF
fi fi

View File

@ -3,6 +3,7 @@
set -e set -e
target_bits=64 target_bits=64
target_cpu_family=x86_64
target_cpu=x86_64 target_cpu=x86_64
lib_suffix=64 lib_suffix=64
target_endian=little target_endian=little
@ -13,6 +14,7 @@ case "$1" in
;; ;;
-32) -32)
target_bits=32 target_bits=32
target_cpu_family=x86
target_cpu=i686 target_cpu=i686
lib_suffix= lib_suffix=
shift shift
@ -71,7 +73,7 @@ meson() {
cat >$BUILD_ROOT/tmp/meson_cross_$$.txt <<EOF cat >$BUILD_ROOT/tmp/meson_cross_$$.txt <<EOF
[host_machine] [host_machine]
system = 'windows' system = 'windows'
cpu_family = '$target_cpu' cpu_family = '$target_cpu_family'
cpu = '$target_cpu' cpu = '$target_cpu'
endian = '$target_endian' endian = '$target_endian'