summaryrefslogtreecommitdiff
path: root/SConstruct
AgeCommit message (Collapse)Author
2021-07-20SCons: Avoid using Python f-string to preserve Python 3.5 compatRémi Verschelde
Fixes #50629.
2021-07-13Implement the ability to disable classesreduz
* 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.
2021-07-08Add elapsed time print statement to build systemHendrik Brucker
2021-06-21Print a notice when compiling with `target=debug`Hugo Locurcio
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.
2021-06-01LinuxBSD now compiles without vulkan/x11.Fabio Alessandrelli
2021-06-01Remove server platformFabio Alessandrelli
2021-05-31Improve compiler version extractionMmAaXx500
2021-05-04Port changes to the "raycast" module build files from 3.xjfons
2021-04-10Add option modules_enabled_by_defaulttotlmstr
2021-03-23Merge pull request #44398 from RevoluPowered/unit-tests-for-export-templatesRémi Verschelde
Add unit tests for export templates
2021-03-22Add unit tests for export templatesGordon MacPherson
2021-03-20Merge pull request #46966 from qarmin/faster_releaseRémi Verschelde
Allow to not optimize release build
2021-03-14Allow to not optimize release buildRafał Mikrut
2021-03-14Merge pull request #46799 from goostengine/module-includesRémi Verschelde
Provide missing include path for custom modules
2021-03-12Fixes small typos and grammar correctionAnshul7sp1
2021-03-10SCons: Use default env["ENV"] and prepend PATH to itRémi Verschelde
See discussion in #46814. Now going with the safe option again (like in 3.2) as it turns out that we can't rely on user environments on Windows, since each shell has a different set of env variables (especially the ones necessary to use MSVC). SCons does its own magic when we don't pass it an `ENV` dictionary, so we should preserve it and only add things in a second step. Fixes this warning when compiling with MSVC using git-bash.exe: ``` Missing environment variable: WindowsSdkDir ``` Possibly fixes build issues when having both MinGW and MSVC installed and an older SCons version.
2021-03-09SCons: Propagate the user's OS environment in env["ENV"]Rémi Verschelde
This fixes a regression from #46774 where `env["ENV"]` would miss some important env variables on Windows, such as `SystemRoot`, `PATHEXT`, etc. To have those, we can either use the default `ENV` created by SCons, or propagate the whole external environment. Fixes #46790.
2021-03-08Provide additional include paths for custom modulesAndrii Doroshenko (Xrayez)
Allows to use a module as a library, where an include path may start with module's name itself.
2021-03-07SCons: Fix parsing PATH when constructing base environmentRémi Verschelde
We constructed the SCons environment without taking any (shell) environment variables into account, and then appended a few, but too late. This would cause variables like `env[CXX]` not to be properly expanded to respect a non-standard `PATH`. With this fix, setting: ``` PATH=$GODOT_SDK/bin:$PATH ``` will now properly use `$GODOT_SDK/bin/gcc` if available over `/usr/bin/gcc`.
2021-02-25SCons: Fix profile type. It is a stringMateo Kuruk Miccino
2021-02-24SCons: Properly handle overriding default values to bool optionsRémi Verschelde
The `dev=yes` and `production=yes` options work as aliases to set a number of options, while still aiming to allow overriding specific options if the user wishes so. (E.g. `production=yes use_lto=no` should work to enable production defaults *but* disable LTO.) That wasn't working as `ARGUMENTS.get()` returns a string and not a boolean as expected by `BoolVariable`, and this wasn't flagged as a bug... So added a helper method using SCons' `BoolVariable._text2bool` to do the conversion manually.
2021-02-18SCons: Make freetype module a mandatory editor dependencyRémi Verschelde
Fixes #28650.
2021-02-08Merge pull request #43057 from Xrayez/custom_modules_recursiveRémi Verschelde
SCons: Add an option to detect C++ modules recursively
2021-02-03SCons: Add `production=yes` option to use production defaultsRémi Verschelde
This is meant for users making custom builds to match the options used on optimized, official builds. This enables, on the platforms which support them: - `use_static_cpp=yes` (portable binaries for Linux and Windows) - `use_lto=yes` (link time optimizations - note: requires a lot of RAM!) - `debug_symbols=no` (no debug symbols, smaller binaries) Also abort when using MSVC with `production=yes`, as: - It cannot optimize the GDScript VM like GCC or Clang do, leading to significant performance drops. - Its LTO support is unreliable, at least used to trigger crashes last we tried it extensively. All options can still be overridden if specified, and the `dev=yes` option was changed to also support overrides.
2021-02-01Fix incorrect version requirement in the SCons compilation DB commentHugo Locurcio
2020-12-17SCons: Fix build with `p` alias or platform auto-detectionRémi Verschelde
Fixes a pre-existing bug that #44433 exposed. It's pretty hacky, but we use `platform` in `env` both as an optional command line option (instead it can be autodetected, or passed via the `p` alias, and on Linux it might be overridden if you pass one of the convenience alias values), and as the reference value for what platform we're building on. Thus we override `env_base["platform"]` with the autodetected or validated platform, but any call to `opts.Update(env_base)` overrides it with the original command line option... causing e.g. #44448. The proper fix would be to refactor all this so that we don't reuse `env["platform"]` for platform detection (it could instead be e.g. `env.platform` as a member variable which holds the validated value), but for now I'm tapering over the immediate breakage. Fixes #44448 and other breakages induced by #44433.
2020-12-16SCons: Add only selected platform's opts to envRémi Verschelde
Otherwise we can get situations where platform-specific opts with the same name can override each other depending on the order at which platforms are parsed, as was the case with `use_static_cpp` in Linux/Windows. Fixes #44304. This also has the added benefit that the `scons --help` output will now only include the options which are relevant for the selected (or detected) platform.
2020-12-12Don't handle BaseException in build scriptsMarcel Admiraal
2020-11-26[Complex Text Layouts] Add third-party TextServer dependencies (ICU, ↵bruvzg
HarfBuzz, Graphite).
2020-11-25Core: Always enable ptrcall, remove PTRCALL_ENABLED defineRémi Verschelde
ptrcall is now also used to optimize calls in GDScript, on top of the existing use by the GDNative and Mono modules. It no longer makes sense to make it optional.
2020-10-24SCons: Add an option to detect C++ modules recursivelyAndrii Doroshenko (Xrayez)
This adds `custom_modules_recursive` which allows to detect and collect all nested C++ modules which may reside in any directory specified by `custom_modules` option. The detection logic is made to be more strict because `SCSub` may be used for organizing hierarchical builds within a module itself, so the existence of `register_types.h` and `config.py` is checked as well (these are all required for a C++ module to be compiled by Godot). For performance reasons, built-in modules are not checked recursively, and there's no benefit of doing so in the first place. It's now possible to specify a directory path pointing to a *single* module, as it may contain nested modules which are detected recursively.
2020-10-08SCons: Refactor and cleanup warnings definitionRémi Verschelde
2020-09-27Add all headers to VS ProjectBartłomiej T. Listwon
2020-09-10Remove unused Python imports.Marcel Admiraal
2020-08-13Merge pull request #41219 from akien-mga/gles2-takes-holidaysRémi Verschelde
Remove obsolete GLES2 backend code
2020-08-13Remove obsolete GLES2 backend codeRémi Verschelde
This code currently isn't compiled (and cannot compile). We plan to re-add OpenGL ES-based renderer(s) in Godot 4.0 alongside Vulkan (probably ES 3.0, possibly also a low-end ES 2.0), but the code will be quite different so it's not relevant to keep this old Godot 3.2 code. The `drivers/gles2` code from the `3.2` branch can be used as a reference for a potential new implementation.
2020-08-12update to use scons compile db toolGordon MacPherson
2020-07-28SCons: Refactor running commands through buildersAndrii Doroshenko (Xrayez)
A new `env.Run` method is added which allows to control the verbosity of builders output automatically depending on whether the "verbose" option is set. It also allows to optionally run any SCons commands in a subprocess using the existing `run_in_subprocess` method, unifying the interface. `Action` objects wrap all builder functions to include a short build message associated with any action. Notably, this removes quite verbose output generated by `make_doc_header` and `make_editor_icons_action` builders.
2020-07-26CI: Install master version of psf/blackRémi Verschelde
Until https://github.com/psf/black/pull/1328 makes it in a stable release, we have to use the latest from Git. Apply new style fixes done by latest black.
2020-07-26SCons: Build tests/ and main/ in cloned environmentsRémi Verschelde
Allows switching `tests=yes`/`no` and rebuilding only tests and main, instead of the whole engine. Co-authored-by: Andrii Doroshenko (Xrayez) <xrayez@gmail.com>
2020-07-26Move `tests` to the top-level directoryAndrii Doroshenko (Xrayez)
2020-07-25SCons: Add `tests` option to enable or disable unit testsAndrii Doroshenko (Xrayez)
2020-07-24t Add unit testing to Godot using DocTest and added to GitHub Actions CIRevoluPowered
Implements exit codes into the engine so tests can return their statuses. Ideally we don't do this, and we use FIXUP logic to 'begin' and 'end' the engine execution for tests specifically. Since realistically we're initialising the engine here we don't want to do that, since String should not require an engine startup to test a single header. This lowers the complexity of running the unit tests and even for physics should be possible to implement such a fix.
2020-07-14SCons: Do not enable werror=yes by defaultRémi Verschelde
There are too many users who compile Godot from source and are not familiar with the buildsystem or C/C++ compilation warnings, and thus report any kind of yet-unfixed warning as a (often duplicate) bug. Compiler warnings change at every compiler version and are different for each compiler, so it's difficult to ensure that the codebase would always be 100% warning-free, especially in the future. I already disabled it for stable releases in #37958, but having it on non stable commits could also become an annoyance in the future when trying to bisect issues with a new compiler version which emits warnings unknown at the time of commit. TL;DR: Contributors, use `dev=yes` or `werror=yes`. CI does and won't let you create new warnings ;)
2020-07-12Disable "misleading indentation" warning on GCCAaron Franke
2020-06-10Merge pull request #37248 from Xrayez/env-dumpRémi Verschelde
SCons: Dump construction environment to a file
2020-06-10SCons: Dump construction environment to a fileAndrii Doroshenko (Xrayez)
A new `methods.dump(env)` is added to dump the construction environment used by SCons to build Godot to a `.scons_env.json`. The file can be used for debugging purposes and any external tool.
2020-06-03SCons: Validate dependencies for linked multimedia modulesRémi Verschelde
This is still a bit hacky and eventually we should rework the way we handle optional dependencies (especially with regard to builtin/system libs), but it's a simple first step. Fixes #39219.
2020-05-29Merge pull request #39137 from Xrayez/custom-modules-profileRémi Verschelde
SCons: Allow to read `custom_modules` option via a file
2020-05-29SCons: Allow to read `custom_modules` option via a fileAndrii Doroshenko (Xrayez)
The `custom_modules` option was only read via the command line by fetching `ARGUMENTS` dictionary directly. Instead, the option's value can now be read via any existing configuration files (`custom.py`) as well as command line, while also updating the environment.