Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.3 cherrypicks #10347

Merged
merged 29 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d94727f
Update using_transforms.rst to clarify rotate_local() axis usage
furkanCalik7 Oct 6, 2024
32705a4
Update handling_quit_requests.rst
ztc0611 Aug 15, 2024
bb8c89f
Update android export page for AAB requirement (#9637)
skyace65 Nov 17, 2024
3c0106b
Update vectors_advanced.rst
ntlblpm Nov 17, 2024
fec6259
Update matrices_and_transforms.rst
ntlblpm Nov 17, 2024
e163152
Document `rand_weighted()` in Random number generation (#10283)
Calinou Nov 18, 2024
8b1a1b6
Improved style for cross-language examples.
wlsnmrk Oct 8, 2023
eb2a0a0
Fix wrong editor setting in Overview of Debugging Tools
tetrapod00 Nov 19, 2024
4f1c986
Remove performance comparison from C# Basics
tetrapod00 Nov 19, 2024
d104230
Add dev_build and dev_mode flags to scons compilation instructions fo…
jonathansekela Sep 29, 2024
3eb1469
Add FAQ entry "Which programming language is fastest?"
tetrapod00 Nov 19, 2024
032be9e
Clarify Area2D warning behavior (#10173)
Kushal-Dev94 Nov 21, 2024
ce1be2c
Add GDScript naming convention summary table
tetrapod00 Nov 20, 2024
d560aac
Update PackedArray explanation to match Godot 4.0 behavior (#10304)
mechalynx Nov 22, 2024
250aefc
Delete mention of OpenGL ES 2
dustdfg Nov 22, 2024
d9964f7
Mention documentation comments in GDScript basics
Calinou Oct 16, 2024
7b0674e
Document focus StyleBox caveats in Introduction to GUI skinning
Calinou Nov 23, 2024
13a47e3
Remove link to Reddit list of tutorials
tetrapod00 Nov 24, 2024
54dd8c1
Use Stretch Ratio instead of prior Ratio terminology
tgnottingham Nov 23, 2024
627bd0e
Remove wiki reference in Introduction to 3D
tetrapod00 Nov 24, 2024
ccf9538
update groups image in saving_games tutorial
syntaxerror247 Nov 25, 2024
c66f811
Document `generate_bundle=yes` SCons option in Compiling for macOS an…
Calinou Oct 16, 2024
4302a98
Fix wording of OpenGL ES support on desktop in Internal rendering arc…
danila-zol Nov 26, 2024
68eb940
Update C# Rider install steps for now built-in plugin "Godot Support"…
RB35 Nov 27, 2024
dc92545
Remove instructions on setting up Pyston for faster development
Calinou Nov 29, 2024
83d7bb5
Fix outdated reference to `godot.tools.html` in Compiling for the Web
Calinou Nov 29, 2024
43ef9a7
Update saving_games.rst
ntlblpm Nov 29, 2024
4ba3e37
Replace mentions of Reference with RefCounted
quinnyo Nov 29, 2024
3489cc5
Update file_access.h location
esainane Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Document generate_bundle=yes SCons option in Compiling for macOS an…
…d iOS

- Reorder instructions to mention ARM64 builds first in macOS,
  as this is the primary architecture in use now (with all new Macs
  since 2023 being sold with Apple Silicon only). The `lipo` command still
  works as before, as it infers the architecture from the input files.
- Remove the manual bundle generation steps to make the page shorter
  (similar to Compiling for Android).
- Remove references to the master branch (this was only relevant when
  4.0 was still in development).
  • Loading branch information
Calinou authored and mhilbrunner committed Nov 30, 2024
commit c66f8114602b883f75d71f91bf50ca1b4e1a3bb1
45 changes: 18 additions & 27 deletions contributing/development/compiling/compiling_for_ios.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ Requirements
Xcode and need to install iOS support, go to *Xcode -> Settings... -> Platforms*.
- Go to *Xcode -> Settings... -> Locations -> Command Line Tools* and select
an installed version. Even if one is already selected, re-select it.

If you are building the ``master`` branch:

- Download and follow README instructions to build a static ``.xcframework``
from the `MoltenVK SDK <https://github.com/KhronosGroup/MoltenVK#fetching-moltenvk-source-code>`__.

Expand All @@ -49,46 +46,40 @@ If you are building the ``master`` branch:
Compiling
---------

Open a Terminal, go to the root dir of the engine source code and type:
Open a Terminal, go to the root folder of the engine source code and type
the following to compile a debug build:

::

scons platform=ios target=template_debug
scons platform=ios target=template_debug generate_bundle=yes

for a debug build, or:
To compile a release build:

::

scons platform=ios target=template_release

for a release build (check ``platform/ios/detect.py`` for the compiler
flags used for each configuration).
scons platform=ios target=template_release generate_bundle=yes

Alternatively, you can run
Alternatively, you can run the following command for Xcode simulator libraries (optional):

::

scons platform=ios target=template_debug ios_simulator=yes arch=x86_64
scons platform=ios target=template_debug ios_simulator=yes arch=arm64
scons platform=ios target=template_debug ios_simulator=yes arch=x86_64 generate_bundle=yes

for a Simulator libraries.
These simulator libraries cannot be used to run the exported project on the
target device. Instead, they can be used to run the exported project directly on
your Mac while still testing iOS platform-specific functionality.

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.template_debug.arm64.a ios_xcode/libgodot.ios.debug.xcframework/ios-arm64/libgodot.a
lipo -create libgodot.ios.template_debug.arm64.simulator.a libgodot.ios.template_debug.x86_64.simulator.a -output ios_xcode/libgodot.ios.debug.xcframework/ios-arm64_x86_64-simulator/libgodot.a

cp libgodot.ios.template_release.arm64.a ios_xcode/libgodot.ios.release.xcframework/ios-arm64/libgodot.a
lipo -create libgodot.ios.template_release.arm64.simulator.a libgodot.ios.template_release.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.
should be placed in ``libgodot.ios.debug.xcframework`` and
``libgodot.ios.release.xcframework`` respectively. This process can be automated
by using the ``generate_bundle=yes`` option on the *last* SCons command used to
build export templates (so that all binaries can be included).

The MoltenVK static ``.xcframework`` folder must also be placed in the
``ios_xcode`` folder once it has been created. MoltenVK is always statically
linked on iOS; there is no dynamic linking option available, unlike macOS.

Run
---
Expand Down
52 changes: 22 additions & 30 deletions contributing/development/compiling/compiling_for_macos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,54 +125,46 @@ To build macOS export templates, you have to compile using the targets without
the editor: ``target=template_release`` (release template) and
``target=template_debug``.

Official templates are universal binaries which support both Intel x86_64 and
ARM64 architectures. You can also create export templates that support only one
of those two architectures by leaving out the ``lipo`` step below.
Official templates are *Universal 2* binaries which support both ARM64 and Intel
x86_64 architectures.

- For Intel x86_64::
- To support ARM64 (Apple Silicon) + Intel x86_64::

scons platform=macos target=template_release arch=x86_64
scons platform=macos target=template_debug arch=arm64
scons platform=macos target=template_release arch=arm64
scons platform=macos target=template_debug arch=x86_64
scons platform=macos target=template_release arch=x86_64 generate_bundle=yes

- For Arm64 (Apple M1)::
- To support ARM64 (Apple Silicon) only (smaller file size, but less compatible with older hardware)::

scons platform=macos target=template_release arch=arm64
scons platform=macos target=template_debug arch=arm64

To support both architectures in a single "Universal 2" binary, run the above
two commands blocks and then use ``lipo`` to bundle them together::

lipo -create bin/godot.macos.template_release.x86_64 bin/godot.macos.template_release.arm64 -output bin/godot.macos.template_release.universal
lipo -create bin/godot.macos.template_debug.x86_64 bin/godot.macos.template_debug.arm64 -output bin/godot.macos.template_debug.universal
scons platform=macos target=template_release arch=arm64 generate_bundle=yes

To create an ``.app`` bundle like in the official builds, you need to use the
template located in ``misc/dist/macos_template.app``. The release and debug
builds should be placed in ``macos_template.app/Contents/MacOS`` with the names
``godot_macos_release.universal`` and ``godot_macos_debug.universal`` respectively. You can do so
with the following commands (assuming a universal build, otherwise replace the
``.universal`` extension with the one of your arch-specific binaries)::

cp -r misc/dist/macos_template.app .
mkdir -p macos_template.app/Contents/MacOS
cp bin/godot.macos.template_release.universal macos_template.app/Contents/MacOS/godot_macos_release.universal
cp bin/godot.macos.template_debug.universal macos_template.app/Contents/MacOS/godot_macos_debug.universal
chmod +x macos_template.app/Contents/MacOS/godot_macos*
template located in ``misc/dist/macos_template.app``. This process can be automated by using
the ``generate_bundle=yes`` option on the *last* SCons command used to build export templates
(so that all binaries can be included). This option also takes care of calling ``lipo`` to create
an *Universal 2* binary from two separate ARM64 and x86_64 binaries (if both were compiled beforehand).

.. note::

If you are building the ``master`` branch, you also need to include support
for the MoltenVK Vulkan portability library. By default, it will be linked
statically from your installation of the Vulkan SDK for macOS.
You can also choose to link it dynamically by passing ``use_volk=yes`` and
including the dynamic library in your ``.app`` bundle::
You also need to include support for the MoltenVK Vulkan portability
library. By default, it will be linked statically from your installation of
the Vulkan SDK for macOS. You can also choose to link it dynamically by
passing ``use_volk=yes`` and including the dynamic library in your ``.app``
bundle::

mkdir -p macos_template.app/Contents/Frameworks
cp <Vulkan SDK path>/macOS/libs/libMoltenVK.dylib macos_template.app/Contents/Frameworks/libMoltenVK.dylib

In most cases, static linking should be preferred as it makes distribution
easier. The main upside of dynamic linking is that it allows updating
MoltenVK without having to recompile export templates.

You can then zip the ``macos_template.app`` folder to reproduce the ``macos.zip``
template from the official Godot distribution::

zip -q -9 -r macos.zip macos_template.app
zip -r9 macos.zip macos_template.app

Using Pyston for faster development
-----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion tutorials/export/exporting_for_macos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Exporting for macOS

macOS apps exported with the official export templates are exported as a single "Universal 2" binary ``.app`` bundle, a folder with a specific structure which stores the executable, libraries and all the project files.
This bundle can be exported as is, packed in a ZIP archive or DMG disk image (only supported when exporting from a computer running macOS).
`Universal binaries for macOS support both Intel x86_64 and ARM64 (Apple silicon, i.e. M1) architectures <https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary>`__.
`Universal binaries for macOS support both Intel x86_64 and ARM64 (Apple Silicon) architectures <https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary>`__.

Requirements
------------
Expand Down