Skip to content

Commit 463b957

Browse files
authored
Merge pull request #10 from godotengine/macos-arm64
OSX: Build universal binaries with ARM64
2 parents 9ddda05 + c44015d commit 463b957

File tree

4 files changed

+35
-23
lines changed

4 files changed

+35
-23
lines changed

build-ios/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export OPTIONS="debug_symbols=no"
1010
export OPTIONS_MONO="module_mono_enabled=yes mono_static=yes"
1111
export TERM=xterm
1212

13-
export IOS_SDK="14.0"
13+
export IOS_SDK="14.2"
1414
export IOS_LIPO="/root/ioscross/arm64/bin/arm-apple-darwin11-lipo"
1515

1616
export IOS_GODOT_LIBS="libgodot libgodot_arkit_module libgodot_camera_module"

build-macosx/build.sh

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -e
66

77
export BUILD_NAME=official
88
export SCONS="scons -j${NUM_CORES} verbose=yes warnings=no progress=no"
9-
export OPTIONS="osxcross_sdk=darwin19 debug_symbols=no"
9+
export OPTIONS="osxcross_sdk=darwin20 debug_symbols=no"
1010
export OPTIONS_MONO="module_mono_enabled=yes mono_static=yes mono_prefix=/root/dependencies/mono"
1111
export TERM=xterm
1212

@@ -20,14 +20,20 @@ tar xf /root/godot.tar.gz --strip-components=1
2020
if [ "${CLASSICAL}" == "1" ]; then
2121
echo "Starting classical build for macOS..."
2222

23-
$SCONS platform=osx $OPTIONS tools=yes target=release_debug
23+
$SCONS platform=osx $OPTIONS arch=x86_64 tools=yes target=release_debug
24+
$SCONS platform=osx $OPTIONS arch=arm64 tools=yes target=release_debug
25+
lipo -create bin/godot.osx.opt.tools.x86_64 bin/godot.osx.opt.tools.arm64 -output bin/godot.osx.opt.tools.universal
2426

2527
mkdir -p /root/out/tools
2628
cp -rvp bin/* /root/out/tools
2729
rm -rf bin
2830

29-
$SCONS platform=osx $OPTIONS tools=no target=release_debug
30-
$SCONS platform=osx $OPTIONS tools=no target=release
31+
$SCONS platform=osx $OPTIONS arch=x86_64 tools=no target=release_debug
32+
$SCONS platform=osx $OPTIONS arch=arm64 tools=no target=release_debug
33+
lipo -create bin/godot.osx.opt.debug.x86_64 bin/godot.osx.opt.debug.arm64 -output bin/godot.osx.opt.debug.universal
34+
$SCONS platform=osx $OPTIONS arch=x86_64 tools=no target=release
35+
$SCONS platform=osx $OPTIONS arch=arm64 tools=no target=release
36+
lipo -create bin/godot.osx.opt.x86_64 bin/godot.osx.opt.arm64 -output bin/godot.osx.opt.universal
3137

3238
mkdir -p /root/out/templates
3339
cp -rvp bin/* /root/out/templates
@@ -43,14 +49,20 @@ if [ "${MONO}" == "1" ]; then
4349
cp -r /root/mono-glue/GodotSharp/GodotSharp/Generated modules/mono/glue/GodotSharp/GodotSharp/
4450
cp -r /root/mono-glue/GodotSharp/GodotSharpEditor/Generated modules/mono/glue/GodotSharp/GodotSharpEditor/
4551

46-
$SCONS platform=osx $OPTIONS $OPTIONS_MONO tools=yes target=release_debug copy_mono_root=yes
52+
$SCONS platform=osx $OPTIONS $OPTIONS_MONO arch=x86_64 tools=yes target=release_debug copy_mono_root=yes
53+
$SCONS platform=osx $OPTIONS $OPTIONS_MONO arch=arm64 tools=yes target=release_debug copy_mono_root=yes
54+
lipo -create bin/godot.osx.opt.tools.x86_64.mono bin/godot.osx.opt.tools.arm64.mono -output bin/godot.osx.opt.tools.universal.mono
4755

4856
mkdir -p /root/out/tools-mono
4957
cp -rvp bin/* /root/out/tools-mono
5058
rm -rf bin
5159

52-
$SCONS platform=osx $OPTIONS $OPTIONS_MONO tools=no target=release_debug
53-
$SCONS platform=osx $OPTIONS $OPTIONS_MONO tools=no target=release
60+
$SCONS platform=osx $OPTIONS $OPTIONS_MONO arch=x86_64 tools=no target=release_debug
61+
$SCONS platform=osx $OPTIONS $OPTIONS_MONO arch=arm64 tools=no target=release_debug
62+
lipo -create bin/godot.osx.opt.debug.x86_64.mono bin/godot.osx.opt.debug.arm64.mono -output bin/godot.osx.opt.debug.universal.mono
63+
$SCONS platform=osx $OPTIONS $OPTIONS_MONO arch=x86_64 tools=no target=release
64+
$SCONS platform=osx $OPTIONS $OPTIONS_MONO arch=arm64 tools=no target=release
65+
lipo -create bin/godot.osx.opt.x86_64.mono bin/godot.osx.opt.arm64.mono -output bin/godot.osx.opt.universal.mono
5466

5567
mkdir -p /root/out/templates-mono
5668
cp -rvp bin/* /root/out/templates-mono

build-release.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ if [ "${build_classical}" == "1" ]; then
136136
## OSX (Classical) ##
137137

138138
# Editor
139-
binname="${godot_basename}_osx.64"
139+
binname="${godot_basename}_osx.universal"
140140
rm -rf Godot.app
141141
cp -r git/misc/dist/osx_tools.app Godot.app
142142
mkdir -p Godot.app/Contents/MacOS
143-
cp out/macosx/x64/tools/godot.osx.opt.tools.64 Godot.app/Contents/MacOS/Godot
143+
cp out/macosx/tools/godot.osx.opt.tools.universal Godot.app/Contents/MacOS/Godot
144144
chmod +x Godot.app/Contents/MacOS/Godot
145145
zip -q -9 -r "${reldir}/${binname}.zip" Godot.app
146146
rm -rf Godot.app
@@ -150,8 +150,8 @@ if [ "${build_classical}" == "1" ]; then
150150
cp -r git/misc/dist/osx_template.app .
151151
mkdir -p osx_template.app/Contents/MacOS
152152

153-
cp out/macosx/x64/templates/godot.osx.opt.64 osx_template.app/Contents/MacOS/godot_osx_release.64
154-
cp out/macosx/x64/templates/godot.osx.opt.debug.64 osx_template.app/Contents/MacOS/godot_osx_debug.64
153+
cp out/macosx/templates/godot.osx.opt.universal osx_template.app/Contents/MacOS/godot_osx_release.64
154+
cp out/macosx/templates/godot.osx.opt.debug.universal osx_template.app/Contents/MacOS/godot_osx_debug.64
155155
chmod +x osx_template.app/Contents/MacOS/godot_osx*
156156
zip -q -9 -r "${templatesdir}/osx.zip" osx_template.app
157157
rm -rf osx_template.app
@@ -324,18 +324,18 @@ if [ "${build_mono}" == "1" ]; then
324324
## OSX (Mono) ##
325325

326326
# Editor
327-
binname="${godot_basename}_mono_osx.64"
327+
binname="${godot_basename}_mono_osx.universal"
328328
rm -rf Godot_mono.app
329329
cp -r git/misc/dist/osx_tools.app Godot_mono.app
330330
mkdir -p Godot_mono.app/Contents/MacOS
331-
cp out/macosx/x64/tools-mono/godot.osx.opt.tools.64.mono Godot_mono.app/Contents/MacOS/Godot
331+
cp out/macosx/tools-mono/godot.osx.opt.tools.universal.mono Godot_mono.app/Contents/MacOS/Godot
332332
mkdir -p Godot_mono.app/Contents/{Frameworks,Resources}
333333
mkdir -p Godot_mono.app/Contents/{Frameworks,Resources}/GodotSharp
334334
mkdir -p Godot_mono.app/Contents/{Frameworks,Resources}/GodotSharp/Mono
335-
cp -rp out/macosx/x64/tools-mono/GodotSharp/Api Godot_mono.app/Contents/Frameworks/GodotSharp
336-
cp -rp out/macosx/x64/tools-mono/GodotSharp/Mono/lib Godot_mono.app/Contents/Frameworks/GodotSharp/Mono
337-
cp -rp out/macosx/x64/tools-mono/GodotSharp/Tools Godot_mono.app/Contents/Frameworks/GodotSharp
338-
cp -rp out/macosx/x64/tools-mono/GodotSharp/Mono/etc Godot_mono.app/Contents/Resources/GodotSharp/Mono
335+
cp -rp out/macosx/tools-mono/GodotSharp/Api Godot_mono.app/Contents/Frameworks/GodotSharp
336+
cp -rp out/macosx/tools-mono/GodotSharp/Mono/lib Godot_mono.app/Contents/Frameworks/GodotSharp/Mono
337+
cp -rp out/macosx/tools-mono/GodotSharp/Tools Godot_mono.app/Contents/Frameworks/GodotSharp
338+
cp -rp out/macosx/tools-mono/GodotSharp/Mono/etc Godot_mono.app/Contents/Resources/GodotSharp/Mono
339339
cp -rp out/aot-compilers Godot_mono.app/Contents/Frameworks/GodotSharp/Tools/
340340
chmod +x Godot_mono.app/Contents/MacOS/Godot
341341
zip -q -9 -r "${reldir_mono}/${binname}.zip" Godot_mono.app
@@ -346,9 +346,9 @@ if [ "${build_mono}" == "1" ]; then
346346
cp -r git/misc/dist/osx_template.app .
347347
mkdir -p osx_template.app/Contents/MacOS
348348

349-
cp out/macosx/x64/templates-mono/godot.osx.opt.debug.64.mono osx_template.app/Contents/MacOS/godot_osx_debug.64
350-
cp out/macosx/x64/templates-mono/godot.osx.opt.64.mono osx_template.app/Contents/MacOS/godot_osx_release.64
351-
cp -rp out/macosx/x64/templates-mono/data.mono.osx.64.* osx_template.app/Contents/MacOS/
349+
cp out/macosx/templates-mono/godot.osx.opt.debug.universal.mono osx_template.app/Contents/MacOS/godot_osx_debug.64
350+
cp out/macosx/templates-mono/godot.osx.opt.universal.mono osx_template.app/Contents/MacOS/godot_osx_release.64
351+
cp -rp out/macosx/templates-mono/data.mono.osx.universal.* osx_template.app/Contents/MacOS/
352352
chmod +x osx_template.app/Contents/MacOS/godot_osx*
353353
zip -q -9 -r "${templatesdir_mono}/osx.zip" osx_template.app
354354
rm -rf osx_template.app

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ ${podman_run} -v ${basedir}/build-linux:/root/build -v ${basedir}/out/linux/x86:
185185
mkdir -p ${basedir}/out/javascript
186186
${podman_run} -v ${basedir}/build-javascript:/root/build -v ${basedir}/out/javascript:/root/out localhost/godot-javascript:${img_version} bash build/build.sh 2>&1 | tee ${basedir}/out/logs/javascript
187187

188-
mkdir -p ${basedir}/out/macosx/x64
189-
${podman_run} -v ${basedir}/build-macosx:/root/build -v ${basedir}/out/macosx/x64:/root/out localhost/godot-osx:${img_version} bash build/build.sh 2>&1 | tee ${basedir}/out/logs/macosx
188+
mkdir -p ${basedir}/out/macosx
189+
${podman_run} -v ${basedir}/build-macosx:/root/build -v ${basedir}/out/macosx:/root/out localhost/godot-osx:${img_version} bash build/build.sh 2>&1 | tee ${basedir}/out/logs/macosx
190190

191191
mkdir -p ${basedir}/out/android
192192
${podman_run} -v ${basedir}/build-android:/root/build -v ${basedir}/out/android:/root/out localhost/godot-android:${img_version} bash build/build.sh 2>&1 | tee ${basedir}/out/logs/android

0 commit comments

Comments
 (0)