godot/modules
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
..
basis_universal SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
bmp [Core] Make ImageFormatLoader extensible. 2022-09-20 02:01:57 +02:00
camera Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
csg SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
cvtt SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
dds Add static methods for creating Image and ImageTexture 2022-07-08 13:40:47 +02:00
denoise SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
enet [Net] Expose get_remote_address get_remote_port. 2022-08-26 10:47:55 +02:00
etcpak SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
freetype SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
gdscript SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
glslang Adding Variable Rate Shading support to Godot 2022-07-17 15:42:24 +10:00
gltf SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
gridmap SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
hdr [Core] Make ImageFormatLoader extensible. 2022-09-20 02:01:57 +02:00
jpg [Core] Make ImageFormatLoader extensible. 2022-09-20 02:01:57 +02:00
jsonrpc Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
lightmapper_rd Implement Physical Light Units as an optional setting. 2022-08-31 12:14:46 -07:00
mbedtls [Net] Rename "ssl" references to "tls" in methods and members. 2022-09-08 03:24:23 +02:00
meshoptimizer Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
minimp3 Make "Godot source files" comment consistent in modules 2022-08-05 17:09:11 -05:00
mobile_vr Implement Vector4, Vector4i, Projection 2022-07-23 14:00:01 +02:00
mono SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
msdfgen [Scons] Implement module dependency sorting. 2022-08-04 20:00:19 +02:00
multiplayer SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
navigation SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
noise Rename hint_tooltip to tooltip_text & setget 2022-08-27 01:35:01 +02:00
ogg Change Array arguments to TypedArray 2022-09-01 13:13:19 +02:00
openxr SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
raycast Style: Cleanup header guards for consistency 2022-09-26 13:51:17 +02:00
regex Change Array arguments to TypedArray 2022-09-01 13:13:19 +02:00
squish Refactor module initialization 2022-05-04 17:34:51 +02:00
svg [Core] Make ImageFormatLoader extensible. 2022-09-20 02:01:57 +02:00
text_server_adv SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
text_server_fb SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
tga Merge pull request #65717 from Ithamar/feat-tga-16bits 2022-09-26 08:23:11 +02:00
theora Rename the argument tag to param in XML documentation 2022-08-08 22:34:31 +03:00
tinyexr SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
upnp Update UPnP documentation 2022-08-28 19:09:19 +02:00
vhacd Refactor module initialization 2022-05-04 17:34:51 +02:00
vorbis [Scons] Implement module dependency sorting. 2022-08-04 20:00:19 +02:00
webp [Core] Make ImageFormatLoader extensible. 2022-09-20 02:01:57 +02:00
webrtc [WebRTC] Expose more of the WebRTC API. 2022-09-13 14:46:58 +02:00
websocket SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
webxr Get WebXR minimally working again in Godot 4 2022-09-19 21:10:27 -05:00
xatlas_unwrap SCons: Unify tools/target build type configuration 2022-09-26 16:31:46 +02:00
modules_builders.py SCons: Improve logic to generate modules_tests.gen.h 2022-02-08 13:01:35 +01:00
register_module_types.h Refactor module initialization 2022-05-04 17:34:51 +02:00
SCsub SCons: Improve logic to generate modules_tests.gen.h 2022-02-08 13:01:35 +01:00