From 3d4c03d0e6d63ca94142da690402394ca22da307 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Sat, 19 Jul 2025 17:16:20 +0000 Subject: [PATCH] build: fix Mac M1 build on my Mini Fix the Mac builder on my M1 Mini. Update glib and get it building. Add command line tools include and lib directories to flags. Add a necessary clang flag to fix vbam build with CoreAudio. Signed-off-by: Rafael Kitover --- src/wx/CMakeLists.txt | 3 +++ tools/builder/core.sh | 4 ++-- tools/macOS/builder | 16 +++++++++------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/wx/CMakeLists.txt b/src/wx/CMakeLists.txt index fcc84b56..1b4bdc3a 100644 --- a/src/wx/CMakeLists.txt +++ b/src/wx/CMakeLists.txt @@ -394,6 +394,9 @@ if(APPLE) default ) endif() + +# Needed for CoreAudio. + target_compile_options(visualboyadvance-m PRIVATE -Wno-error=elaborated-enum-base) endif() target_sources(visualboyadvance-m PRIVATE ${VBAM_WX_COMMON} ${VBAM_ICON_PATH}) diff --git a/tools/builder/core.sh b/tools/builder/core.sh index 6dc12015..79407e15 100644 --- a/tools/builder/core.sh +++ b/tools/builder/core.sh @@ -180,7 +180,7 @@ DISTS=$DISTS' XML-Parser https://cpan.metacpan.org/authors/id/T/TO/TODDR/XML-Parser-2.47.tar.gz perl5/man/man3/XML*Parser.3* intltool https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz bin/intltoolize ninja https://github.com/ninja-build/ninja/archive/v1.12.1.tar.gz bin/ninja - glib https://download.gnome.org/sources/glib/2.85/glib-2.85.0.tar.xz lib/libglib-2.0.a + glib https://download.gnome.org/sources/glib/2.85/glib-2.85.1.tar.xz lib/libglib-2.0.a libgpg-error https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.54.tar.bz2 lib/libgpg-error.a libgcrypt https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.11.0.tar.bz2 lib/libgcrypt.a libsecret https://gitlab.gnome.org/GNOME/libsecret/-/archive/0.21.7/libsecret-0.21.7.tar.bz2 lib/libsecret-1.a @@ -374,7 +374,7 @@ DIST_ARGS="$DIST_ARGS graphviz --disable-ltdl --without-x --disable-swig CFLAGS=\"-include \$PWD/declspec.h \$CFLAGS\" CC=\"\$CXX\" python2 --with-ensurepip=install --with-system-expat python3 --with-ensurepip=install --with-system-expat - glib -Dtests=false + glib -Dtests=false -Ddtrace=disabled XML-Parser EXPATINCPATH=\"\$BUILD_ROOT/root/include\" EXPATLIBPATH=\"\$BUILD_ROOT/root/lib\" libcroco --disable-Bsymbolic snappy -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF diff --git a/tools/macOS/builder b/tools/macOS/builder index 50ecdc77..52bb63c7 100755 --- a/tools/macOS/builder +++ b/tools/macOS/builder @@ -126,14 +126,14 @@ export PATH="$best_llvm_path/bin:$BREW_PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin" export CC="$clang_path/bin/clang $target_build_arch" export CPP="$clang_path/bin/clang -E $target_build_arch" export CXX="$clang_path/bin/clang++ $target_build_arch" -export CPPFLAGS="-DICONV_CONST=" -export CFLAGS="-framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -Wl,-no_compact_unwind" -export CXXFLAGS="-framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -Wl,-no_compact_unwind" -export OBJCXXFLAGS="-framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -Wl,-no_compact_unwind" -export LDFLAGS="-framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -Wl,-no_compact_unwind" +export CPPFLAGS="-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -DICONV_CONST=" +export CFLAGS="-framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument" +export CXXFLAGS="-framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument" +export OBJCXXFLAGS="-framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument" +export LDFLAGS="-L\"\$BUILD_ROOT/root/lib\" -lintl -liconv -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -Wl,-no_compact_unwind" -export UUID_CFLAGS="-I\$BUILD_ROOT/root/stow/libuuid/include" -export UUID_LIBS="-L\$BUILD_ROOT/root/stow/libuuid/lib -luuid" +export UUID_CFLAGS="-I\"\$BUILD_ROOT/root/stow/libuuid/include\"" +export UUID_LIBS="-L\"\$BUILD_ROOT/root/stow/libuuid/lib\" -luuid" EOF ) @@ -231,6 +231,8 @@ table_line_append DIST_CONFIGURE_OVERRIDES ffmpeg "--disable-videotoolbox --extr #table_line_append DIST_PATCHES ffmpeg "-p0 https://gist.githubusercontent.com/rkitover/db75d083b74617b186eec11965c1da74/raw/20da2f8c6d8c02ce284096c5e805ae671351cc6e/ffmpeg-macos10-7.patch" +table_line_append DIST_PATCHES glib "-p0 https://gist.githubusercontent.com/rkitover/100b6ecf6e1c049aa32975be22395c4e/raw/abab7c71458c42d6750f2dec9b913ba085834fce/static-libintle-macos-glib.patch" + if [ -n "$APPLE_SILICON" ] && [ "$target_cpu" != ARM64 ]; then table_line_append DIST_CONFIGURE_OVERRIDES ffmpeg '--disable-asm' fi