Up to date
This page is up to date for Godot 4.2
.
If you still find outdated information, please open an issue.
Compiler pour iOS¶
Voir aussi
Cette page décrit comment compiler les binaires du modèle d'exportation iOS à partir du code source. Si vous souhaitez plutôt exporter votre projet vers iOS, lisez Exportation pour iOS.
Pré-requis¶
SCons 3.0+ système de construction(build).
Xcode (ou les outils en ligne de commande plus légers pour Xcode).
If you are building the master
branch:
Download and follow README instructions to build a static
.xcframework
from the MoltenVK SDK.
Note
If you have Homebrew installed, you can easily install SCons using the following command:
brew install scons
L'installation de Homebrew permet également de récupérer automatiquement les outils de ligne de commande pour Xcode si vous ne les avez pas déjà.
Similarly, if you have MacPorts installed, you can easily install SCons using the following command:
sudo port install scons
Voir aussi
Pour récupérer le code source de Godot pour le compiler, voir Obtenir la source.
Pour un aperçu général de l'utilisation de SCons pour Godot, voir Introduction au buildsystem.
Compilation¶
Ouvrez un terminal, allez à la racine du code source du moteur et tapez :
$ scons p=ios target=template_debug
pour une construction de débogage, ou :
$ scons p=ios target=template_release
for a release build (check platform/ios/detect.py
for the compiler
flags used for each configuration).
Alternativement, vous pouvez exécuter
$ scons p=ios target=template_debug ios_simulator=yes arch=x86_64
$ scons p=ios target=template_debug ios_simulator=yes arch=arm64
for a Simulator libraries.
To create an Xcode project like in the official builds, you need to use the
template located in misc/dist/ios_xcode
. The release and debug libraries
should be placed in libgodot.ios.debug.xcframework
and libgodot.ios.release.xcframework
respectively.
$ cp -r misc/dist/ios_xcode .
$ cp libgodot.ios.debug.arm64.a ios_xcode/libgodot.ios.debug.xcframework/ios-arm64/libgodot.a
$ lipo -create libgodot.ios.debug.arm64.simulator.a libgodot.ios.debug.x86_64.simulator.a -output ios_xcode/libgodot.ios.debug.xcframework/ios-arm64_x86_64-simulator/libgodot.a
$ cp libgodot.ios.opt.arm64.a ios_xcode/libgodot.ios.release.xcframework/ios-arm64/libgodot.a
$ lipo -create libgodot.ios.opt.arm64.simulator.a libgodot.ios.opt.x86_64.simulator.a -output ios_xcode/libgodot.ios.release.xcframework/ios-arm64_x86_64-simulator/libgodot.a
The MoltenVK static .xcframework
folder must also be placed in the ios_xcode
folder once it has been created.
Exécution¶
Pour exécuter sur un appareil ou un simulateur, suivez ces instructions : Exportation pour iOS.