summaryrefslogtreecommitdiffstats
path: root/SConstruct
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #37248 from Xrayez/env-dumpRémi Verschelde2020-06-101-1/+4
|\ | | | | SCons: Dump construction environment to a file
| * SCons: Dump construction environment to a fileAndrii Doroshenko (Xrayez)2020-06-101-1/+4
| | | | | | | | | | | | 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.
* | SCons: Validate dependencies for linked multimedia modulesRémi Verschelde2020-06-031-8/+7
| | | | | | | | | | | | | | | | 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.
* | Merge pull request #39137 from Xrayez/custom-modules-profileRémi Verschelde2020-05-291-4/+9
|\ \ | | | | | | SCons: Allow to read `custom_modules` option via a file
| * | SCons: Allow to read `custom_modules` option via a fileAndrii Doroshenko (Xrayez)2020-05-291-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | SCons: Prefer `Exit()` method over `sys.exit()`Andrii Doroshenko (Xrayez)2020-05-281-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sconscript provides it's own `Exit()` method which is currently an alias for `sys.exit()` internally, with the only difference that if no exit code is specified, it defaults to 0. This encourages the usage of SCons-implemented methods like `Glob()` over `glob.glob()`, which may overcome limitations of the built-in Python features in the future.
* | | Merge pull request #39125 from Xrayez/py-modules-order-4.0Rémi Verschelde2020-05-281-3/+4
|\ \ \ | |_|/ |/| | SCons: use `OrderedDict` to ensure insertion order of modules
| * | SCons: use `OrderedDict` to ensure insertion order of modulesAndrii Doroshenko (Xrayez)2020-05-281-3/+4
| |/ | | | | | | | | | | | | | | | | The insertion order for dictionaries is only a language feature for Python 3.6/3.7+ implementations, and not prior to that. This ensures that the engine won't be rebuilt if the order of detected modules changes in any way, as the `OrderedDict` should guarantee inerstion order.
* | Merge pull request #37198 from Xrayez/progress-insideRémi Verschelde2020-05-271-117/+1
|\ \ | |/ |/| SCons: Move build progress related logic out of main SConstruct
| * Moved to methods.py as a `show_progress` method.Andrii Doroshenko (Xrayez)2020-03-301-117/+1
| | | | | | | | | | | | Some required changes are made: - locally imported SCons-specific packages within the method; - `global` variables converted to `nonlocal` (used in nested functions).
* | Add `custom_modules` build option to compile external user modulesAndrii Doroshenko (Xrayez)2020-05-251-23/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds ability to include external, user-defined C++ modules to be compiled as part of Godot via `custom_modules` build option which can be passed to `scons`. ``` scons platform=x11 tools=yes custom_modules="../project/modules" ``` Features: - detects all available modules under `custom_modules` directory the same way as it does for built-in modules (not recursive); - works with both relative and absolute paths on the filesystem; - multiple search paths can be specified as a comma-separated list. Module custom documentation and editor icons collection and generation process is adapted to work with absolute paths needed by such modules. Also fixed doctool bug mixing absolute and relative paths respectively. Implementation details: - `env.module_list` is a dictionary now, which holds both module name as key and either a relative or absolute path to a module as a value. - `methods.detect_modules` is run twice: once for built-in modules, and second for external modules, all combined later. - `methods.detect_modules` was not doing what it says on the tin. It is split into `detect_modules` which collects a list of available modules and `write_modules` which generates `register_types` sources for each. - whether a module is built-in or external is distinguished by relative or absolute paths respectively. `custom_modules` scons converter ensures that the path is absolute even if relative path is supplied, including expanding user paths and symbolic links. - treats the parent directory as if it was Godot's base directory, so that there's no need to change include paths in cases where custom modules are included as dependencies in other modules.
* | SCons: Improve registration of compilation_db tool, check versionRémi Verschelde2020-05-181-7/+6
| | | | | | | | | | | | | | | | | | There's a builtin `toolpath` option we can use for that, so no need to hack around a custom `scons_site` path. The script requires SCons 3.1.1 or later, so we enable it conditionally. Follow-up to #32848.
* | Added compilation database support for clang and gccRevoluPowered2020-05-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | This tool is originally from mongodb. - Updated CPPSUFFIXES to use scons suffixes - objective-c files will also be loaded into the compilation database where the compiler / tooling is available to compile the files. Known limitations: - This will not work with msvc as your compiler.
* | New lightmapperJuan Linietsky2020-05-101-0/+7
| | | | | | | | | | | | | | -Added LocalVector (needed it) -Added stb_rect_pack (It's pretty cool, we could probably use it for other stuff too) -Fixes and changes all around the place -Added library for 128 bits fixed point (required for Delaunay3D)
* | SCons: Disable -Werror on 'stable' releasesRémi Verschelde2020-04-171-1/+3
| | | | | | | | | | | | | | | | | | Stable releases are tagged and need to stay easy to compile in the future. As new compiler versions introduce new warnings or catch more occurrences, have -Werror set in tagged releases could be a bother. We still want it on by default for all Godot developers, so it's now conditional.
* | Fix for Vulkan loader related build error caused by incomplete aliasARebel2020-03-311-0/+1
| | | | | | | | | | Fixes #37465. The #37369 commit which added an alias for linuxbsd platform did not work with the latest branch.
* | SCons: Treat all warnings as errorsRémi Verschelde2020-03-301-1/+3
|/ | | | | | | | | After an effort spanning several years, we should now be warning-free on all major compilers, so we can set `-Werror` to ensure that we don't introduce warnings in new code. Disable -Werror=strict-overflow on GCC 7 though, as it seems bogus and was fixed in 8+.
* SCons: Format buildsystem files with psf/blackRémi Verschelde2020-03-301-217/+260
| | | | | | | | | | | | | | | | | | | | | Configured for a max line length of 120 characters. psf/black is very opinionated and purposely doesn't leave much room for configuration. The output is mostly OK so that should be fine for us, but some things worth noting: - Manually wrapped strings will be reflowed, so by using a line length of 120 for the sake of preserving readability for our long command calls, it also means that some manually wrapped strings are back on the same line and should be manually merged again. - Code generators using string concatenation extensively look awful, since black puts each operand on a single line. We need to refactor these generators to use more pythonic string formatting, for which many options are available (`%`, `format` or f-strings). - CI checks and a pre-commit hook will be added to ensure that future buildsystem changes are well-formatted.
* Alias `platform=x11` to `platform=linuxbsd` in SConsHugo Locurcio2020-03-281-0/+8
| | | | | | | This makes it possible for users to follow outdated documentation and still get a working binary. This closes #37367.
* Effective DisplayServer separation, rename X11 -> LinuxBSDJuan Linietsky2020-03-261-1/+1
|
* SCons: Drop support for Python 2Rémi Verschelde2020-03-251-2/+3
| | | | | | We now require SCons 3.0+ (first version with Python 3 support), and we set min required Python 3 version to 3.5 (3.4 and earlier are EOL).
* assimp: Clean and document buildsystem, prepare for unbundlingRémi Verschelde2020-03-061-0/+1
| | | | | | | | | | - Improve the SCsub to allow unbundling and remove unnecessary code. - Move files around to match upstream source. - Re-sync with upstream commit 308db73d0b3c2d1870cd3e465eaa283692a4cf23 to ensure we don't have local modifications. - Doesn't actually build against current version 5.0.1 due to the lack of the new ArmaturePopulate API that Gordon authored. We'll have to wait for a public release with that API (5.1?) to enable unbundling.
* Remove '/permissive-' flag from Windows MSVC buildPouleyKetchoupp2020-03-041-1/+1
| | | | | This flag is causing compilation issues with headers from older versions of Windows SDK (before 10.0.16299.0).
* SCons: Fix get_compiler_version() to return intsRémi Verschelde2020-02-261-15/+13
| | | | | | Otherwise comparisons would fail for compiler versions above 10. Also simplified code somewhat to avoid using subprocess too much needlessly.
* SCons: Re-allow upcoming GCC 8.4, fixes C++17 copy elisionRémi Verschelde2020-02-261-9/+11
| | | | | | | Follow-up to #36484. The patches for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521 have now landed in the `releases/gcc-8` branch and will be in GCC 8.4.
* Scons: fixed build for vanilla clang in mac os xNickolai Korshunov2020-02-241-4/+10
|
* SCons: Add GCC/Clang minimum version checkRémi Verschelde2020-02-231-0/+30
| | | | | | | | Prevent using GCC 8 as it does not properly support C++17's guaranteed copy elision which we now need. (Upstream bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521) Follow-up to #36457 and #36436.
* Replace FALLTHROUGH macro by C++17 [[fallthrough]]Rémi Verschelde2020-02-231-2/+2
| | | | | | | | | | This attribute is now part of the standard we target so we no longer need compiler-specific hacks. Also enables -Wimplicit-fallthrough for Clang now that we can properly support it. It's already on by default for GCC's -Wextra. Fixes new warnings raised by Clang's -Wimplicit-fallthrough.
* SCons: Ensure that MSVC gets /std:c++17 in CCFLAGSRémi Verschelde2020-02-221-9/+10
| | | | | We were running this logic too early, so `env.msvc` was not initialized yet and MSVC used the same branch as GCC/Clang.
* SCons: Bump required C++ standard to C++17Rémi Verschelde2020-02-221-5/+5
| | | | | | | | | | | | | | | | | | | | | | As per #36436, we now need C++17's guaranteed copy elision feature to solve ambiguities in Variant. Core developers discussed the idea to move from C++14 to C++17 as our minimum required C++ standard, and all agreed. Note that this doesn't mean that Godot is going to be written in "modern C++", but we'll use modern features where they make sense to simplify our "C with classes" codebase. Apart from new code written recently, most of the codebase still has to be ported to use newer features where relevant. Proper support for C++17 means that we need recent compiler versions: - GCC 7+ - Clang 6+ - VS 2017 15.7+ Additionally, C++17's `std::shared_mutex` (conditionally used by `vk_mem_alloc.h` when C++17 support is enabled) is only available in macOS 10.12+, so we increase our minimum supported version.
* SCons: Explicitly define our C (C11) and C++ (C++14) standardsRémi Verschelde2020-02-201-5/+16
| | | | | | | | | | | | | On GCC and Clang, we use C11 and C++14 with GNU extensions (`std=gnu11` and `std=gnu++14`). Those are the defaults for current GCC and Clang, and also match the feature sets we want to use in Godot. On MSVC, we require C++14 support explicitly with `/std:c++14`, and make it strict with the use of `/permissive-` (so features of C++17 or later can't be used). Moves the definition before querying environment flags and platform config so that it can be overridden when necessary.
* Fix compilation warnings and re-enable werror=yes on TravisRémi Verschelde2020-02-181-1/+7
| | | | | | | | | | | | | | | | | | | | | Fix -Wunused-variable, -Wunused-but-set-variable and -Wswitch warnings raised by GCC 8 and 9. Fix -Wunused-function, -Wunused-private-field and -Wtautological-constant-out-of-range-compare raised by Clang. Fix MSVC 2019 warning C4804 (unsafe use of type 'bool' in comparison operation). GCC -Wcpp warnings/Clang -W#warnings (`#warning`) are no longer raising errors and will thus not abort compilation with `werror=yes`. Treat glslang headers are system headers to avoid raising warnings. Re-enables us to build with `werror=yes` on Linux and macOS, thus catching warnings that would be introduced by new code. Fixes #36132.
* Remove more deprecated methods and codeRémi Verschelde2020-02-131-11/+1
|
* Remove obsolete GLES3 backendRémi Verschelde2020-02-131-2/+1
| | | | | | | | | | | | | | Due to the port to Vulkan and complete redesign of the rendering backend, the `drivers/gles3` code is no longer usable in this state and is not planned to be ported to the new architecture. The GLES2 backend is kept (while still disabled and non-working) as it will eventually be ported to serve as the low-end renderer for Godot 4.0. Some GLES3 features might be selectively ported to the updated GLES2 backend if there's a need for them, and extensions we can use for that. So long, OpenGL driver bugs!
* glslang: Disable warnings and allow unbundlingRémi Verschelde2020-02-111-0/+1
|
* SCons: Streamline Vulkan buildsystem + fixupsRémi Verschelde2020-02-111-1/+1
| | | | | | | | | | | - Renamed option to `builtin_vulkan`, since that's the name of the library and if we were to add new components, we'd likely use that same option. - Merge `vulkan_loader/SCsub` in `vulkan/SCsub`. - Accordingly, don't use built-in Vulkan headers when not building against the built-in loader library. - Drop Vulkan registry which we don't appear to need currently. - Style and permission fixes.
* Add runtime GLES2 / Vulkan context selection.bruvzg2020-02-111-2/+0
|
* Add static Vulkan loader.bruvzg2020-02-111-0/+4
| | | | | Initial Vulkan support for Windows. Initial Vulkan support for macOS.
* A lot of progress with canvas rendering, still far from working.Juan Linietsky2020-02-111-0/+1
|
* - Integrated NavigationServer and Navigation2DServer.Andrea Catania2020-02-101-0/+1
| | | | | | | - Added Navigation Agents and Obstacles. - Integrated Collision Avoidance. This work has been kindly sponsored by IMVU.
* SCons: Split libmodules.a in folder-based libsRémi Verschelde2020-02-071-2/+0
| | | | | This removes the need for the hacky split_libmodules logic on Windows, since all libs are now of manageable size.
* Use modules_enabled.gen.h to improve inter dependency checksRémi Verschelde2020-02-071-3/+0
| | | | | | | - Fix build with gdscript module disabled. Fixes #31011. - Remove unused `gdscript` compile option. - Fix build with regex module disabled. - Fix ImageLoaderSVG to forward declare thirdparty structs.
* SCons: Generate header with info on which modules are enabledRémi Verschelde2020-02-071-2/+2
| | | | | | | | | We already had `MODULE_*_ENABLED` defines but only in the modules environment, and a few custom `*_ENABLED` defines in the main env when we needed the information in core. Now this is defined in a single header which can be included in the files that need this information.
* Added support to allow to compile Godot from the same directory while using ↵Fabian Mathews2020-01-011-0/+4
| | | | | | different versions of python (cherry picked from commit beee8b37763dd25a105d75274b3f2fffe35f69e1)
* SCons: Add 'split_libmodules' option to workaround linker issueRémi Verschelde2019-12-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | The new 'split_libmodules=yes' option is useful to work around linker command line size limitations when linking a huge number of objects. We're currently over 64k chars when linking libmodules.a on Windows with MinGW, which triggers issues as seen in #30892. Even on Linux, we can also reach linker command line size limitations by adding more custom modules. We force this option to True for MinGW on Windows, which fixes #30892. Additional changes to lib splitting: - Fix linking of the split module libs with interdependent symbols, hacking our way into LINKCOM and SHLINKCOM to set the `--start-group` and `--end-group` flags. - Fix Python 3 compatibility in `methods.split_lib()`. - Drop seemingly obsolete condition for 'msys' on 'posix'. - Drop the unnecessary 'split_drivers' as the drivers lib is no longer too big since we moved all thirdparty builds to modules. Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
* pcre2: Use scons option to disable JIT on some platformsRémi Verschelde2019-11-201-0/+1
| | | | | | | | Third-party platforms (e.g. console ports) need to be able to disable JIT support in the regex module too, so it can't be hardcoded in the module SCsub. This is cleaner this way anyway. Fixes #19316.
* Remove dependency on the editor directory being in the build's include path.Marcel Admiraal2019-10-101-1/+1
| | | | | | | - Add or remove the necessary subdirectorires to the includes to remove dependency on the editor directory being in the build's include path. - Ensure includes in modified files conform to style guideline. - Remove editor from the build include path.
* Prevent editor compilation with regex module disabled, which is not supportedPouleyKetchoupp2019-08-111-0/+7
|
* SCons: Enable C++11 on the whole codebaseRémi Verschelde2019-07-221-0/+4
| | | | | | | | | | | | | | | | | **Important:** This does not mean *yet* that C++11 features should be used in contributions to Godot's codebase. For now this change is done solely for feature branches working on Vulkan support and GDScript typed instruction sets for Godot 4.0, which will both use C++11 features and are based on the master branch. The plan is to start porting the codebase to C++11 after Godot 3.2 is released, following upcoming guidelines on the subset of new features that should be used, and when/how to use them. We will advertise clearly when C++11 contributions are open, especially once we start a coordinated effort to port Godot's massive codebase. In the meantime, please bear with us and good ol' C++03. :)
* Add a `platform=list` SCons argument to list platformsHugo Locurcio2019-07-171-3/+13
| | | | | This also improves the message display and makes an invalid selection exit with a non-zero status code.