Skip to content

Commit 77a7542

Browse files
committed
Cross compile x86_64 deps on arm mac CI
1 parent 762b92a commit 77a7542

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

.github/workflows/build-macos.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
matrix:
2525
# make arm64 deps and x86_64 deps
2626
include:
27-
- { macarch: arm64, os: macos-14 }
28-
- { macarch: x86_64, os: macos-13 }
27+
- { macarch: arm64, os: macos-15 }
28+
- { macarch: x86_64, os: macos-15 }
2929

3030
steps:
3131
- uses: actions/checkout@v5.0.0
@@ -64,8 +64,8 @@ jobs:
6464
fail-fast: false # if a particular matrix build fails, don't skip the rest
6565
matrix:
6666
include:
67-
- { macarch: arm64, os: macos-14 }
68-
- { macarch: x86_64, os: macos-13 }
67+
- { macarch: arm64, os: macos-15 }
68+
- { macarch: x86_64, os: macos-15 }
6969

7070
env:
7171
MAC_ARCH: ${{ matrix.macarch }}

buildconfig/macdependencies/build_mac_deps.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,21 @@ else
4949
# install NASM to generate optimised x86_64 libjpegturbo builds
5050
brew install nasm
5151

52+
# for scripts using ./configure to make x86_64 binaries
53+
export CC="clang -target x86_64-apple-macos10.11"
54+
export CXX="clang++ -target x86_64-apple-macos10.11"
55+
56+
export PG_BASE_CONFIGURE_FLAGS="$PG_BASE_CONFIGURE_FLAGS --host=x86_64-apple-darwin"
57+
58+
# configure cmake to cross-compile
59+
export PG_BASE_CMAKE_FLAGS="$PG_BASE_CMAKE_FLAGS -DCMAKE_OSX_ARCHITECTURES=x86_64"
60+
5261
# SDL 2.26.5 new minimum macos is 10.11, so we build our x86 mac deps
5362
# for 10.11 as well.
5463
export MACOSX_DEPLOYMENT_TARGET=10.11
5564

56-
# needs native-file that has correct macosx deployment target
57-
export PG_BASE_MESON_FLAGS="$PG_BASE_MESON_FLAGS --native-file $(pwd)/macos_x86_64.ini"
65+
# configure meson to cross-compile with correct target
66+
export PG_BASE_MESON_FLAGS="$PG_BASE_MESON_FLAGS --cross-file $(pwd)/macos_x86_64.ini"
5867
fi
5968

6069
cd ../manylinux-build/docker_base

buildconfig/macdependencies/macos_x86_64.ini

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
[constants]
2-
macos_ver = ['-mmacosx-version-min=10.11']
2+
macos_ver = ['-target', 'x86_64-apple-macos10.11']
3+
4+
[host_machine]
5+
system = 'darwin'
6+
cpu_family = 'x86_64'
7+
cpu = 'x86_64'
8+
endian = 'little'
39

410
[binaries]
511
c = ['clang']

0 commit comments

Comments
 (0)