Commit Graph

508 Commits

Author SHA1 Message Date
Thaddeus Crews
4fb2ebe695 SCons: Bump minimum SCons & Python versions
SCons: 3.1.2 → 4.0
Python: 3.6 → 3.8
(cherry picked from commit 66fe2c8b44)
2025-04-19 03:27:39 -04:00
George L. Albany
66372fa825 Merge pull request #933 from Spartan322/4.3.1-cherry-pick/enhancements
[4.3] Cherry-picks for the 4.3 (4.3.1) branch - 1st enhancements batch
2025-01-18 17:50:43 +00:00
HP van Braam
d30d5dec2b Unconditionally use env.Decider("MD5-timestamp")
It seems that we are only enabling this option together with unsafe
build determinators. However it seems that MD5-timestamp by itself is
not unsafe.

MD5-Timestamp works by first checking the timestamp of a file, comparing
it to the scons database and if it does not match it will do an md5sum
to determine if the file needs rebuilding.

Without this option SCons will always create md5sums of every file. In
the case of a null build this is 50% of the time.

(cherry picked from commit 04fff3fe0d)
2025-01-18 11:16:28 -05:00
bruvzg
25cfb194fd [Windows] Use dwarf-4 for clang builds on Windows.
(cherry picked from commit 800076a6c2)
2025-01-18 06:54:54 -05:00
bruvzg
cb8ece49f1 [Windows] Fix MinGW debug symbols.
(cherry picked from commit 404383e161)
2025-01-18 06:54:41 -05:00
Yevhen Babiichuk (DustDFG)
2a7cf821db Make module dependency check recursive
The `env.disabled_modules` and `methods.disable_module` weren't used anywhere
so the first one was repurposed and the second just deleted

Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
(cherry picked from commit 8e75e029b3)
2025-01-18 06:48:14 -05:00
Pedro J. Estébanez
491f397117 Add a utility cache line size constant
(cherry picked from commit 95c6a24795)
2025-01-17 21:51:21 -05:00
Trashguy
9901f655fb Rebrand Godot 4.3 to Redot 2024-10-13 15:05:24 -04:00
A Thousand Ships
d51be1f68d [Buildsystem] Improve cache handling
Prevents cache issues by not purging cache before starting a build.
Splits cache purge related code from progress code and delays the purge
until after final build is done.

(cherry picked from commit acffc53e01)
2024-09-17 08:57:45 +02:00
Hakim
400800a86c Make sure not to generate the compile_commands.json when not asked 2024-08-09 23:42:38 +02:00
Rémi Verschelde
d2064fea52 SCons: Load optional ninja tool before setting its options
SCons 4.8.0 made this stricter, as we were advised in #94805.

Fixes #94805.
2024-07-31 23:03:59 +02:00
Rémi Verschelde
4e5ed0bbfb Merge pull request #93753 from Repiteo/scons/visual-studio-fixes
SCons: Fix output with `vsproj=yes`
2024-07-22 17:30:25 +02:00
Rémi Verschelde
543f694e2c Merge pull request #94109 from akien-mga/scons-linker-optflags
SCons: Pass optimization flags to the linker too, needed by Emscripten
2024-07-11 00:27:17 +02:00
Fabio Alessandrelli
3d553eccdf [Web] Fix debug symbols in web builds 2024-07-10 14:18:57 +02:00
Rémi Verschelde
7d708626a3 SCons: Pass optimization flags to the linker too, needed by Emscripten 2024-07-09 09:34:02 +02:00
Rémi Verschelde
8897c77d50 SCons: Default optimize to auto, fixing target/dev_build inference for Web
Fixes #94087.
2024-07-09 00:21:29 +02:00
Thaddeus Crews
8a24f44fe5 SCons: Fix output with vsproj=yes 2024-06-29 13:11:19 -05:00
Kusok
0c6dbbd050 Fix not using encoding="utf-8" when writing to files or reading from them
Co-authored-by: ChristopheClaustre <christophe.claustre.31@gmail.com>
2024-06-19 23:35:03 +08:00
Rémi Verschelde
0d11108a01 Merge pull request #79126 from bruvzg/SteamTime
Enable optional minimal SteamAPI integration for usage time tracking (editor only).
2024-06-03 12:42:38 +02:00
bruvzg
c34d64669e Enable optional minimal SteamAPI integration for usage time tracking (editor only). 2024-05-31 11:01:02 +03:00
Rémi Verschelde
37cf266b57 SCons: Process platform-specific flags earlier
Some of the logic in SCons depends on flags that get overridden in the
platform-specific `detect.py`, so it needs to be processed first.

For example the Android/iOS/Web platforms override the default `target`
to `template_debug`, but this was processed too late so e.g. the logic
that sets `env.editor_build` would set it to true due to the default
`target` value in the environment being `editor`.
2024-05-30 16:01:43 +02:00
Thaddeus Crews
5d265e9a7e SCons: Minor fixes/adjustments for web compilation 2024-05-24 12:30:24 -05:00
Thaddeus Crews
896b003cc8 SCons: Convert platform get_flags to dictionary 2024-05-22 13:53:20 -05:00
Jakub Marcowski
d9f8ef68df Update pre-commit hooks configuration to use ruff instead of black 2024-05-21 18:02:29 -05:00
Thaddeus Crews
a9810cffb4 SCons: Fix potential Windows ANSI exception 2024-05-18 13:14:31 -05:00
Rémi Verschelde
a63c37dca1 SCons: Bump min version to 3.1.2, test it on CI with one Linux job
The min SCons version had to be bumped as SCons 3.0 before 3.0.3 seems
broken (see #92043), and there's little gain from supporting 3.0.3-3.0.5.

3.1.2 is also the first version to avoid ambiguities between Python 2
and Python 3 usage, so we finally use it as the minimum baseline.

Also test against Python 3.6 which is also our minimum supported version.
This should help prevent regressions whenever we modernize the build scripts.
2024-05-17 11:18:57 +02:00
Rémi Verschelde
856fbc68b3 SCons: Restore compatibility with SCons < 4.0.0
Fixes #91986.
2024-05-17 09:01:07 +02:00
bruvzg
2818abe9ed [SCons] Add options to override AR, AR and RC flags, 2024-05-15 13:03:17 +03:00
Rémi Verschelde
5ae85fc6ab Merge pull request #91833 from akien-mga/scons-min-gcc-version-9
SCons: Bump minimum supported GCC version to GCC 9
2024-05-14 18:09:54 +02:00
Rémi Verschelde
c5395d3ce2 Merge pull request #91866 from programneer/dont-splash-my-editor
Don't define `NO_EDITOR_SPLASH` in export templates
2024-05-13 12:05:56 +02:00
Programneer
efaba30116 Don't define NO_EDITOR_SPLASH in export templates 2024-05-12 13:12:56 +02:00
Rémi Verschelde
a04ba55790 SCons: Bump minimum supported GCC version to GCC 9
- GCC 7 supports C++17 but seems to have breaking regressions, see #79352.
- GCC 8 broke C++17 guaranteed copy elision support, fixed in 8.4, but...
- GCC 9 is old enough (2022) to use as a baseline and stop dealing with
  unmaintained and less efficient compiler versions.
2024-05-11 15:19:33 +02:00
Rémi Verschelde
d4d0e34bb4 SCons: Preserve Environment values when updating Variables
Finally reading the docs for `SCons.Variables.Update` let me find this optional
parameter, which solves the hacks and pain we've dealt with for years:

> args (optional) – a dictionary of keys and values to update in env.
> If omitted, uses the variables from the commandline.

By passing the environment itself, we preserve the values we've overridden in
`SConstruct` or `detect.py`.
2024-05-10 16:57:23 +02:00
Thaddeus Crews
34fb3f7730 SCons: Generate all scripts natively 2024-05-07 15:30:45 -05:00
Thaddeus Crews
e0e8ce1fc0 SCons: Colorize warnings/errors during generation 2024-04-28 16:24:48 -05:00
Thaddeus Crews
fd2ab721e2 SCons: scons_version to environment variable 2024-04-24 09:41:12 +02:00
Thaddeus Crews
e115f478ea SCons: Only use alias if SCons v4.3 or later 2024-04-23 11:48:28 -05:00
Thaddeus Crews
5a87f0da21 SCons: Utilize native Variable alias functionality 2024-04-18 09:27:26 -05:00
Thaddeus Crews
41fee42c40 SCons: Convert env_base to env 2024-04-17 12:26:20 -05:00
Programneer
2980593995 Only define ENGINE_UPDATE_CHECK_ENABLED in editor builds 2024-04-17 10:00:48 +02:00
kobewi
49e69fabba Add automatic checking for engine updates 2024-04-15 15:08:27 +02:00
Rémi Verschelde
e5c689d028 SCons: Make new debug_paths_relative option opt-in
As pointed out in https://github.com/godotengine/godot/pull/78232#issuecomment-2056467297,
it actually makes it harder to run Godot locally while keeping the relationship with the
header files it was compiled from.
2024-04-15 12:19:36 +02:00
Rémi Verschelde
74e6b5a059 SCons: Add GCC/Clang option to make debug file paths relative 2024-04-12 10:08:03 +02:00
Rémi Verschelde
7e4c150573 SCons: Fix up build with Python 3.10
It gives:

> SyntaxError: f-string expression part cannot include a backslash

Follow-up to #90214.
2024-04-05 13:14:41 +02:00
Thaddeus Crews
c6995be6e4 SCons: Refactor selected_platform conditional 2024-04-04 12:38:58 -05:00
Riteo
55558fb175 SCons: Add an option to enable the experimental ninja build backend
With this option turned on, if properly set up, SCons generates a
`build.ninja` file and quits. To actually build the engine, the user can
then call `ninja` with whatever options they might prefer (not
everything is yet transferred properly to this new generated file).

Ideally, the scons file should never be called again, as ninja
automatically detects any SCons build script change and invokes
the required commands to regenerate itself.

This approach speeds up incremental builds considerably, as it limits
SCons to code generation and uses ninja's extremely fast timestamp-based
file change detector.
2024-03-15 16:05:25 +01:00
Adam Scott
4080992b38 Fix compiledb SCons tool availability 2024-03-14 11:58:57 -04:00
Thaddeus Crews
5a6e3cbcb0 SCons: Remove run_in_subprocess dependency 2024-03-11 13:20:09 -05:00
Thaddeus Crews
0ce9b6fd1d Add two new COMSTR environment variables 2024-03-01 12:44:03 -06:00
Rémi Verschelde
0d1894736e SCons: Fix CCFLAGS, LINKFLAGS, etc. command line overrides
Also adds `CPPDEFINES` which allows passing new pre-processor defines,
letting SCons handle passing `-D` or `/D` based on the compiler.
2024-02-20 15:57:53 +01:00