Commit Graph

237 Commits

Author SHA1 Message Date
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
Rémi Verschelde
49fcf4ffad Style: Cleanup header guards for consistency
Fix file names for {Static,Lightmap}RaycasterEmbree.
2022-09-26 13:51:17 +02:00
Rémi Verschelde
26e9145c26 SCons: Cleanup DEBUG, _DEBUG and NDEBUG defines
- `_DEBUG` is MSVC specific so it didn't make much sense to define for
  Android and iOS builds.
- iOS was the only platform to define `DEBUG`. We don't use it anywhere
  outside thirdparty code, which we usually don't intend to debug, so it
  seems better to be consistent with other platforms.
- Consistently define `NDEBUG` to disable assert behavior in both `release`
  and `release_debug` targets. This used to be set for `release` for all
  platforms, and `release_debug` for Android and iOS only.
- Due to the above, I removed the only use we made of `assert()` in Godot
  code, which was only implemented for Unix anyway, should have been
  `DEV_ENABLED`, and is in PoolAllocator which we don't actually use.
- The denoise and recast modules keep defining `NDEBUG` even for the `debug`
  target as we don't want OIDN and Embree asserting all over the place.
2022-09-23 15:21:26 +02:00
Rémi Verschelde
c5c3d13dc0 SCons: Remove redundant -fomit-frame-pointer and -ftree-vectorize
- `-fomit-frame-pointer` is included automatically by both GCC and
  Clang in `-O1` and above.
- `-ftree-vectorize` is included automatically by GCC in `-O2` and
  beyond, and seems always enabled by Clang.

Closes #66296. See that issue for a detailed investigation.
2022-09-23 13:56:16 +02:00
Rémi Verschelde
aa553f4030 Merge pull request #65745 from akien-mga/scons-production-lto-earlier
Refactor handling of `production` flag and per-platform LTO defaults
2022-09-20 09:45:33 +02:00
Rémi Verschelde
7da532275b Merge pull request #65541 from clayjohn/renderer-setting
Split rendering driver project setting into renderer_name and rendering_driver
2022-09-20 09:43:59 +02:00
clayjohn
4a1c7de57c Split rendering driver project setting into renderer_name and rendering_driver. To differentiate between a driver (e.g. Vulkan or D3D12) and a renderer (e.g. clustered or mobile renderer). 2022-09-19 10:26:10 -07:00
Rémi Verschelde
35a15e6191 SCons: Refactor handling of production flag and per-platform LTO defaults
Fixup to #63288.
See #65583 for the bug report.

Co-authored-by: Cyberrebell <chainsaw75@web.de>
2022-09-19 18:11:29 +02:00
MJacred
ac9786c525 Add get_distribution_name() and get_version() to OS
supports: LinuxBSD, Windows, macOS, iOS, Android, UWP

Co-authored-by: bruvzg
2022-09-16 11:17:36 +02:00
Ted Spikes
21f7bd0723 Check for ios_simulator when building for x86_64 2022-09-13 14:04:08 +03:00
Rémi Verschelde
c2c659db32 SCons: Refactor LTO options with lto=<none|thin|full>
Adds support for LTO on macOS and Android. We don't have much experience
with LTO on these platforms so for now we keep it disabled by default
even when `production=yes` is set.

Similarly for iOS where we ship object files for the user to link in
Xcode so LTO makes builds extremely slow to link.

`production=yes` defaults to full LTO.
ThinLTO is much faster for LLVM-based compilers but seems to produce
bigger binaries (at least for the Web platform).
2022-09-08 10:00:02 +02:00
Micky
b6daad8d4b Rename range_lerp to remap 2022-09-06 07:19:20 +02:00
Aaron Franke
10a56981dc
Rename String plus_file to path_join 2022-08-29 19:38:13 -05:00
Rémi Verschelde
ca26c78e7e
Merge pull request #64562 from bruvzg/fix_dup_locales
[macOS / iOS Export] Fix generation of duplicate locale property list files.
2022-08-26 10:47:28 +02:00
Hugo Locurcio
ce56743aa1
Improve platform-specific READMEs to add useful links
This also adds READMEs for all platforms.
2022-08-25 17:50:53 +02:00
Aaron Franke
27b0f18275 Unify bits, arch, and android_arch into env["arch"]
Fully removes the `bits` option and adapts the code that relied on it.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-08-25 11:19:20 +02:00
Rémi Verschelde
8c1dc0c7ea
Merge pull request #64630 from nathanfranke/ios-opaque
(4.x) iOS: Force app store icon to be opaque, use proper errors
2022-08-25 08:43:39 +02:00
kobewi
8be27dc59e Replace Array return types with TypedArray 2022-08-22 22:42:36 +02:00
Nathan Franke
d769ff184f
ios: force app store icon to be opaque, use proper errors 2022-08-19 13:19:13 -05:00
bruvzg
16b45ee542
[macOS / iOS Export] Fix generation of duplicate locale property list files. 2022-08-18 09:44:43 +03:00
Fredia Huya-Kouadio
44dc24ec38 Disable threads used to check on plugins to load
The functionality is unavailable on Android (requires export capability) and unnecessarily consumes resources
2022-08-15 02:30:43 -07:00
Fredia Huya-Kouadio
45c7377556 Refactor the export checking logic to improve separation of concerns 2022-08-14 09:12:04 -07:00
Pedro J. Estébanez
8c2a577350 Clean iOS platform config of long gone macro 2022-08-10 21:42:49 +02:00
Sergey Minakov
c99e8aeac3 [iOS] Extend iOS plugins to support Swift runtime 2022-08-09 20:20:54 +03:00
Rémi Verschelde
5df8eae862
Merge pull request #64014 from RedMser/keep-screen-on-singledef 2022-08-08 12:04:04 +02:00
RedMser
c939f336d6 Only define keep_screen_on project setting once 2022-08-06 22:10:24 +02:00
Larry Tran
e029e66454 Remove unnecessary string replacement 2022-08-05 18:15:57 -05:00
Brian Semrau
103c0fa6e6 Add support for multiple virtual keyboard types 2022-08-04 10:41:33 -04:00
Yuri Sizov
9f55bd971e Extract EditorResourceConversionPlugin into its own source files and clean up editor includes 2022-07-31 21:14:15 +03:00
Rémi Verschelde
3e5ad8213f
Merge pull request #63563 from aaronfranke/export-arch 2022-07-30 11:22:25 +02:00
Aaron Franke
a0072ba39f
Make some editor export methods const 2022-07-29 10:24:13 -05:00
Juan Linietsky
d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
Rémi Verschelde
cc5135959b
Merge pull request #62973 from bruvzg/sysfont_support 2022-07-27 13:38:30 +02:00
Aaron Franke
e53ae13178
Split up editor export code into multiple files 2022-07-26 08:28:19 -05:00
bruvzg
36ef8f29dc
Implement support for loading system fonts on Linux, macOS / iOS and Windows. 2022-07-26 08:38:05 +03:00
Rémi Verschelde
90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +02:00
bruvzg
8823eae328
Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00