compiling_for_ios.rst 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. .. _doc_compiling_for_ios:
  2. Compiling for iOS
  3. =================
  4. .. highlight:: shell
  5. .. seealso::
  6. This page describes how to compile iOS export template binaries from source.
  7. If you're looking to export your project to iOS instead, read :ref:`doc_exporting_for_ios`.
  8. Requirements
  9. ------------
  10. - SCons 3.0+ (you can install it via `Homebrew <https://brew.sh/>`_ or
  11. `MacPorts <https://www.macports.org/>`_, you should be able
  12. to run ``scons`` in a terminal when installed).
  13. - Xcode 11.0 (or later) with the iOS (13.0) SDK and the command line tools.
  14. If you are building the ``master`` branch:
  15. - Download and follow README instructions to build a static ``.xcframework``
  16. from the `MoltenVK SDK <https://github.com/KhronosGroup/MoltenVK#fetching-moltenvk-source-code>`__.
  17. .. seealso:: To get the Godot source code for compiling, see
  18. :ref:`doc_getting_source`.
  19. For a general overview of SCons usage for Godot, see
  20. :ref:`doc_introduction_to_the_buildsystem`.
  21. Compiling
  22. ---------
  23. Open a Terminal, go to the root dir of the engine source code and type:
  24. ::
  25. $ scons p=ios target=debug
  26. for a debug build, or:
  27. ::
  28. $ scons p=ios target=release
  29. for a release build (check ``platform/ios/detect.py`` for the compiler
  30. flags used for each configuration).
  31. Alternatively, you can run
  32. ::
  33. $ scons p=ios target=debug ios_simulator=yes arch=x86_64
  34. $ scons p=ios target=debug ios_simulator=yes arch=arm64
  35. for a Simulator libraries.
  36. To create an Xcode project like in the official builds, you need to use the
  37. template located in ``misc/dist/ios_xcode``. The release and debug libraries
  38. should be placed in ``libgodot.ios.debug.xcframework`` and ``libgodot.ios.release.xcframework`` respectively.
  39. ::
  40. $ cp -r misc/dist/ios_xcode .
  41. $ cp libgodot.ios.debug.arm64.a ios_xcode/libgodot.ios.debug.xcframework/ios-arm64/libgodot.a
  42. $ 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
  43. $ cp libgodot.ios.opt.arm64.a ios_xcode/libgodot.ios.release.xcframework/ios-arm64/libgodot.a
  44. $ 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
  45. Run
  46. ---
  47. To run on a device or simulator, follow these instructions:
  48. :ref:`doc_exporting_for_ios`.