godot/platform/macos
Rémi Verschelde 39facb35a0 SCons: Unify tools/target build type configuration
Implements https://github.com/godotengine/godot-proposals/issues/3371.

New `target` presets
====================

The `tools` option is removed and `target` changes to use three new presets,
which match the builds users are familiar with. These targets control the
default optimization level and enable editor-specific and debugging code:

- `editor`: Replaces `tools=yes target=release_debug`.
  * Defines: `TOOLS_ENABLED`, `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_debug`: Replaces `tools=no target=release_debug`.
  * Defines: `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_release`: Replaces `tools=no target=release`.
  * Defines: `-O3`/`/O2`

New `dev_build` option
======================

The previous `target=debug` is now replaced by a separate `dev_build=yes`
option, which can be used in combination with either of the three targets,
and changes the following:

- `dev_build`: Defines `DEV_ENABLED`, disables optimization (`-O0`/`/0d`),
  enables generating debug symbols, does not define `NDEBUG` so `assert()`
  works in thirdparty libraries, adds a `.dev` suffix to the binary name.

Note: Unlike previously, `dev_build` defaults to off so that users who
compile Godot from source get an optimized and small build by default.
Engine contributors should now set `dev_build=yes` in their build scripts or
IDE configuration manually.

Changed binary names
====================

The name of generated binaries and object files are changed too, to follow
this format:

`godot.<platform>.<target>[.dev][.double].<arch>[.<extra_suffix>][.<ext>]`

For example:
- `godot.linuxbsd.editor.dev.arm64`
- `godot.windows.template_release.double.x86_64.mono.exe`

Be sure to update your links/scripts/IDE config accordingly.

More flexible `optimize` and `debug_symbols` options
====================================================

The optimization level and whether to generate debug symbols can be further
specified with the `optimize` and `debug_symbols` options. So the default
values listed above for the various `target` and `dev_build` combinations
are indicative and can be replaced when compiling, e.g.:

`scons p=linuxbsd target=template_debug dev_build=yes optimize=debug`
will make a "debug" export template with dev-only code enabled, `-Og`
optimization level for GCC/Clang, and debug symbols. Perfect for debugging
complex crashes at runtime in an exported project.
2022-09-26 16:31:46 +02:00
..
export Style: Cleanup header guards for consistency 2022-09-26 13:51:17 +02:00
crash_handler_macos.h Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
crash_handler_macos.mm Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
detect.py SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
dir_access_macos.h Add override keywords to DirAccess derived classes 2022-08-02 16:39:44 +01:00
dir_access_macos.mm Rename String plus_file to path_join 2022-08-29 19:38:13 -05:00
display_server_macos.h [macOS] Process menu callback after event processing step to avoid event queue corruption. 2022-09-24 23:57:24 +03:00
display_server_macos.mm [macOS] Process menu callback after event processing step to avoid event queue corruption. 2022-09-24 23:57:24 +03:00
gl_manager_macos_legacy.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
gl_manager_macos_legacy.mm Fix multiwindow support in GLES3 for X11, Windows, and MacOS. 2022-09-12 17:30:50 -07:00
godot_application.h Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
godot_application.mm Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
godot_application_delegate.h Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
godot_application_delegate.mm Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
godot_button_view.h [macOS extend-to-title] Add scene/project name to the editor title, fix incorrect window button position/order when system primary language is RTL. 2022-09-22 23:09:56 +03:00
godot_button_view.mm [macOS extend-to-title] Add scene/project name to the editor title, fix incorrect window button position/order when system primary language is RTL. 2022-09-22 23:09:56 +03:00
godot_content_view.h [macOS, 4.0] Fix unresponsive redraw during live resizing. 2022-09-14 09:59:00 +03:00
godot_content_view.mm [macOS] Fix redraw lag at the edge of the resizing window. 2022-09-15 17:08:12 +03:00
godot_main_macos.mm Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
godot_menu_delegate.h [macOS] Handle accelerator and click events of the global menu items separately. 2022-09-01 08:13:56 +03:00
godot_menu_delegate.mm [macOS] Simplify handling of menu accelerators, and send event to the focused window instead of main. 2022-09-02 13:56:27 +03:00
godot_menu_item.h [macOS] Handle accelerator and click events of the global menu items separately. 2022-09-01 08:13:56 +03:00
godot_menu_item.mm [macOS] Handle accelerator and click events of the global menu items separately. 2022-09-01 08:13:56 +03:00
godot_window.h [macOS extend-to-title] Add scene/project name to the editor title, fix incorrect window button position/order when system primary language is RTL. 2022-09-22 23:09:56 +03:00
godot_window.mm [macOS extend-to-title] Add scene/project name to the editor title, fix incorrect window button position/order when system primary language is RTL. 2022-09-22 23:09:56 +03:00
godot_window_delegate.h [macOS extend-to-title] Add scene/project name to the editor title, fix incorrect window button position/order when system primary language is RTL. 2022-09-22 23:09:56 +03:00
godot_window_delegate.mm [macOS extend-to-title] Add scene/project name to the editor title, fix incorrect window button position/order when system primary language is RTL. 2022-09-22 23:09:56 +03:00
joypad_macos.cpp Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
joypad_macos.h Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
key_mapping_macos.h Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
key_mapping_macos.mm Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
logo.png Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
macos_terminal_logger.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
macos_terminal_logger.mm Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
os_macos.h Add get_distribution_name() and get_version() to OS 2022-09-16 11:17:36 +02:00
os_macos.mm Add get_distribution_name() and get_version() to OS 2022-09-16 11:17:36 +02:00
platform_config.h Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
platform_macos_builders.py Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
README.md Improve platform-specific READMEs to add useful links 2022-08-25 17:50:53 +02:00
SCsub [macOS] Add an option to align window buttons in "extend to title" mode. 2022-09-20 12:55:59 +03:00
tts_macos.h Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
tts_macos.mm Rename range_lerp to remap 2022-09-06 07:19:20 +02:00
vulkan_context_macos.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
vulkan_context_macos.mm Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00

macOS platform port

This folder contains the C++, Objective-C and Objective-C++ code for the macOS platform port.

See also misc/dist/macos folder for additional files used by this platform. misc/dist/macos_tools.app is an .app bundle template used for packaging the macOS editor, while misc/dist/macos_template.app is used for packaging macOS export templates.

Documentation