Skip to content

Commit

Permalink
Set CROSS_COMPILING=1 if building for macos-intel on arm64
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Nov 10, 2024
1 parent baf5a75 commit b1fd593
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
11 changes: 7 additions & 4 deletions setup/check_target.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,24 @@ function check_target() {
"Darwin")
CLANG=1
MACOS=1
if [ "$(uname -m)" = "x86_64" ]; then
if [ "$(uname -m)" = "arm64" ]; then
MACOS_UNIVERSAL=1
fi
;;
"macos"|"macos-intel")
CLANG=1
MACOS=1
if [ "$(uname -m)" = "arm64" ]; then
CROSS_COMPILING=1
fi
;;
"macos-10.15")
CLANG=1
MACOS=1
MACOS_10_15=1
if [ "$(uname -m)" = "arm64" ]; then
CROSS_COMPILING=1
fi
;;
"macos-universal")
CLANG=1
Expand Down Expand Up @@ -166,9 +172,6 @@ function check_target() {
"native")
target=$(uname -s)
check_target
if [ "${target}" = "Darwin" ] && [ "$(uname -m)" = "arm64" ]; then
MACOS_UNIVERSAL=1
fi
;;
default|*)
echo "Invalid target '${target}', possible values are:"
Expand Down
15 changes: 15 additions & 0 deletions setup/meson/macos-10.15.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[binaries]
name = 'macos-10.15'
c = 'gcc'
cpp = 'g++'
ar = 'ar'
nm = 'nm'
ld = 'ld'
strip = 'strip'
pkgconfig = 'pkg-config'

[host_machine]
system = 'macos'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'
15 changes: 15 additions & 0 deletions setup/meson/macos.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[binaries]
name = 'macos'
c = 'gcc'
cpp = 'g++'
ar = 'ar'
nm = 'nm'
ld = 'ld'
strip = 'strip'
pkgconfig = 'pkg-config'

[host_machine]
system = 'macos'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'

0 comments on commit b1fd593

Please sign in to comment.