This PR is a continuation of #50381 (which was implemented exactly a year ago!)
* Add a visual interface to select which classes should not be built into Godot (well, they are built if something else uses them, but if not used the optimizer will remove them out).
* Add a detection system to scan the project and figure out the actual classes used.
* Added the ability for SCons to load build profiles.
Obligatory Screen:
A simple test with a couple of nodes in the scene resulted in a 25% reduction for the final binary size
TODO:
* Script languages need to implement used class detection (left for another PR).
* Options to disable servers or server functionalities (like 2D or 3D physics, navigation, etc). Are missing, that should also greatly aid in reducing binary size.
* Options to disable some modules would be desired.
* More options to disable drivers (OpenGL, Vulkan, etc) would be desired.
In general this PR is a starting point for more contributors to improve and enhance this functionality.
We shouldn't presume that future compilers will not have false positives or
find new occurrences of this warning, which would break compiling old versions
of the engine without passing custom `CXXFLAGS`.
Follow-up to #60652.
SConstruct change also makes it possible to outright delete the `editor`
folder in a `tools=no` build, which we use in CI to ensure no invalid
cross-dependencies are added.
It has been disabled in `master` since one year (#45852) and our plan
is for Bullet, and possibly other thirdparty physics engines, to be
implemented via GDExtension so that they can be selected by the users
who need them.
This reverts #53828 which had caused a significant drop in incremental
rebuild time for debug builds (from 10s to 23s on my laptop).
The "faster but unsafe" options are re-added, as well as adding
`max_drift=60` which we didn't use previously.
These options speed up SCons' own processing of the codebase to decide
what to build/rebuild (i.e. the first step before actually calling the
compiler). This will therefore not make much difference for scratch
builds, and is mostly useful for incremental rebuilds (including "null"
rebuilds with no change).
These options are enabled automatically for `debug` builds, unless
`fast_unsafe=no` is passed.
They are disabled by default for `release` and `release_debug` builds,
unless `fast_unsafe=yes` is passed.
The Godot Project Leadership Committe has decided to update the sponsoring
tiers so that the Platinum Sponsorship no longer includes a logo on the
editor splash screen.
This lets us reclaim the editor splash screen space for community-related
content instead of sponsors (e.g. a different community-designed splash
screen for each stable branch?).
Also removes two Platinum Sponsors whose sponsorship has expired earlier this
year.
When disabling specific modules, misspellings can occur. Additionally,
when switching between the `3.x` and `master` branches frequently,
it's possible to forget about renamed modules such as `lightmapper_cpu`
versus `lightmapper_rd`.
Note, the editor build requires the mbedtls module to be manually
enabled, as it is currently needed as a ResourceUID dependency.
This will need to be addressed in a separate PR.
- Rename OpenGL to GLES3 in the source code per community feedback.
- The renderer is still exposed as "OpenGL 3" to the user.
- Hide renderer selection dropdown until OpenGL support is more mature.
- The renderer can still be changed in the Project Settings or using
the `--rendering-driver opengl` command line argument.
- Remove commented out exporter code.
- Remove some OpenGL/DisplayServer-related debugging prints.
First implementation with Linux display manager.
- Add single-threaded mode for EditorResourcePreview (needed for OpenGL).
Co-authored-by: clayjohn <claynjohn@gmail.com>
Co-authored-by: Fabio Alessandrelli <fabio.alessandrelli@gmail.com>
We've had many issues with WebM support and specifically the libvpx library
over the years, mostly due to its poor integration in Godot's buildsystem,
but without anyone really interested in improving this state.
With the new GDExtensions in Godot 4.0, we intend to move video decoding to
first-party extensions, and this would likely be done using something like
libvlc to expose more codecs.
Removing the `webm` module means we can remove libsimplewebm, libvpx and
opus, which we were only used for that purpose. Both libvpx and opus were
fairly complex pieces of the buildsystem, so this is a nice cleanup.
This also removes the compile-time dependency on `yasm`.
Fixes lots of compilation or non-working WebM issues which will be linked
in the PR.
Current SCons 4.2.0 still supports Python 3.5 but deprecated it, and support
will be removed in the next release.
It's also become needlessly restrictive to prevent ourselves from using Python
3.6 f-Strings, so it's time to up the requirement.
They haven't really helped save much time on incremental rebuilds, and they do
cause potential issues with build correctness (and possibly even one of the cause
for overly eager incremental rebuilds).
Emscripten is LLVM-based so we want to follow the same logic. But we can't just
put it as a match in `methods.using_clang()` as that would mess with the
compiler version detection logic used to restrict old GCC and Clang releases.
It's raised for us on many comparators implemented to be able to store a struct
in `Set` or `Map` (who rely on `operator<` internally). In the cases I reviewed
we don't actually care about the ordering and we use the struct's function
pointers as that's the only distinctive data available.
* This PR adds the ability to disable classes when building.
* For now it's only possible to do this via command like:
`scons disable_classes=RayCast2D,Area3D`
* Eventually, a proper UI will be implemented to create a build config file to do this at large scale, as well as detect what is used in the project.
Debug builds are considerably slower than release builds or even
release_debug builds. `target=debug` is still the default SCons
target option, so unsuspecting users may be compiling unoptimized
debug builds for their personal use.