Commit Graph

243 Commits

Author SHA1 Message Date
A Thousand Ships
acffc53e01
[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.
2024-09-09 16:36:56 +02:00
Alula
346cbc7f1f
Add support for compiling with VS clang-cl toolset 2024-08-28 13:30:44 -05:00
Alvin Wong
c7a7a5a973 MinGW: Print compiler warnings on Windows 2024-08-28 18:20:16 +08:00
Thaddeus Crews
0163705640
SCons: Add method to generate raw cstrings 2024-07-31 14:22:04 -05: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
5514510f7f
Merge pull request #94117 from mhilbrunner/fix-94090-vsproj-scons-4.8
Fix VS project generation with SCons 4.8.0+
2024-07-09 16:47:29 +02:00
Max Hilbrunner
f682406cf2 Fix VS project generation with SCons 4.8.0+ 2024-07-09 09:55:41 +02:00
Zorvalt
5a81d2440f Fix build fetching git_timestamp if git log.showsignature=true 2024-07-08 21:52:07 +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
Thaddeus Crews
5d265e9a7e
SCons: Minor fixes/adjustments for web compilation 2024-05-24 12:30:24 -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
34fb3f7730
SCons: Generate all scripts natively 2024-05-07 15:30:45 -05:00
Thaddeus Crews
dec2a121a9
SCons: Fixes for warn/error colorization 2024-04-29 11:56:21 -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
A Thousand Ships
173692d05d
[Web] Fix building for web on Windows
On Windows the command for emscripten are provided as `.bat` files,
which causes the compiler version check to fail without `shell=True`
2024-04-20 14:06:45 +02:00
Thaddeus Crews
a7e7167a85
SCons: Disable show_progress with ninja 2024-04-18 09:42:02 -05:00
Andreia Gaita
7336ec1f7e Visual Studio: Fix indentation in sln file, VS is VERY PICKY 2024-04-12 16:04:35 +02:00
Andreia Gaita
536ca28ea9 Ensure all Visual Studio files are generated with CRLF 2024-04-10 17:26:36 +02:00
Rémi Verschelde
1f71d491d0
Merge pull request #88244 from shana/vs-improve-settings
Visual Studio: Don't override user options. Add additional vs hint information
2024-04-08 11:19:58 +02:00
Thaddeus Crews
ccb5e15ac2
SCons: Ensure *all* generated files can be cleaned 2024-04-05 10:49:44 -05:00
Rémi Verschelde
7fa97f37fb
Merge pull request #89452 from Riteo/name-a-better-duo
SCons: Enable the experimental Ninja backend and minimize timestamp changes to generated code
2024-04-04 14:31:24 +02:00
A Thousand Ships
4933fa8bf5
[Buildsystem] Fix encoding when reading files 2024-03-24 18:02:56 +01:00
Riteo
a5cf92664d SCons: unify code generations routine and minimize timestamp changes
Previously, all of the code generation routines would just needlessly
write the same files over and over, even when not needed.

This became a problem with the advent of the experimental ninja backend
for SCons, which can be trivially enabled with a few lines of code and
relies on timestamp changes, making it thus impractical.
2024-03-15 15:43:53 +01:00
Thaddeus Crews
5a6e3cbcb0
SCons: Remove run_in_subprocess dependency 2024-03-11 13:20:09 -05:00
Thaddeus Crews
fb299d0fb1
SCons: Ensure with statement where applicable 2024-03-10 12:57:57 -05:00
Thaddeus Crews
d9fa40f2df
Enforce \n eol for Python writes
• Ensure utf-8 encoding if previously unspecified
2024-03-09 14:29:24 -06:00
Thaddeus Crews
0ce9b6fd1d
Add two new COMSTR environment variables 2024-03-01 12:44:03 -06:00
Rémi Verschelde
d9296e5fdd
Merge pull request #88949 from shana/vs-performance-improvement
Visual Studio: Improve performance of parsing project file
2024-02-29 13:54:27 +01:00
Andreia Gaita
d6f2bec890 VS: Improve performance of parsing project file
VS doesn't handle string parsing very well, so having all the files in one
property slows down VS a lot when loading the projects. Splitting the files
up into per-directory properties brings down project processing times from
20 seconds to 1 second (on my machine).
2024-02-28 13:19:22 +01:00
Hugo Locurcio
67e9ccdbc4
Display the build date in the editor and when starting the engine
This can be used to quickly see how recent a development build is,
without having to look up the commit date manually.
When juggling around with various builds (e.g. for benchmarking),
this can also be used to ensure that you're actually running the
binary you intended to run.

The date stored is the date of the Git commit that is built, not
the current date at the time of building the binary. This ensures
binaries can remain reproducible.

The version timestamp can be accessed using the `timestamp` key
of the `Engine.get_version_info()` return value.
2024-02-27 20:39:17 +01:00
Andreia Gaita
1d29fb0853 VS: Fix user workflows with custom user VS configurations
Users can add additional VS project configurations with their own
custom settings, but to support this workflow, we can't rely directly
on $(Platform) and $(Configuration), because VS needs those to be
both unique Configuration|Platform combos, and we need to allow for
different combos of Configuration|Platform to point to the same
scons build configuration.

GodotPlatform and GodotConfiguration properties lets us decouple from
the magic VS properties that we don't control, so users can add
however many Platform|Configuration combos they want and still
point to a specific GodotPlatform|GodotConfiguration build config.
2024-02-12 17:09:52 +01:00
Andreia Gaita
1c7167e9ac VS: Don't override user options. Add additional vs hints
Make sure we include any user-specified project settings in our
project definitions, this way users can customize their VS
environment to more closely match what they're building for, and
they better can control debugging and deployment from VS.

Add support for setting VS-only compiler defines, include paths, and
additional linker options, as a hint to VS to use when loading projects
and parsing code. VS would usually know these on non nmake projects,
but for nmake projects we have to tell it about any implicit information
that the compiler has, so it can resolve symbols in the editor.
2024-02-12 13:36:26 +01:00
Andreia Gaita
7638a6c981 Add new VS proj generation logic that supports any platform that wants to opt in
Custom Visual Studio project generation logic that supports any platform that has a msvs.py
script, so Visual Studio can be used to run scons for any platform, with the right defines per target.

Invoked with `scons vsproj=yes`

To generate build configuration files for all platforms+targets+arch combinations, users should call

```
scons vsproj=yes platform=XXX target=YYY [other build flags]
```

for each combination of platform+target[+arch]. This will generate the relevant vs project files but
skip the build process, so that project files can be quickly generated without waiting for a command line
build. This lets project files be quickly generated even if there are build errors.

All possible combinations of platform+target are created in the solution file by default, but they
won't do anything until each one is set up with a scons vsproj=yes command for the respective platform
in the appropriate command line. This lets users only generate the combinations they need, and VS
won't have to parse settings for other combos.

Only platforms that opt in to vs proj generation by having a msvs.py file in the platform folder are included.
Platforms with a msvs.py file will be added to the solution, but only the current active platform+target+arch
will have a build configuration generated, because we only know what the right defines/includes/flags/etc are
on the active build target currently being processed by scons.

Platforms that don't support an editor target will have a dummy editor target that won't do anything on build,
but will have the files and configuration for the windows editor target.

To generate AND build from the command line, run

```
scons vsproj=yes vsproj_gen_only=no
```
2024-01-31 16:42:42 +01:00
Rémi Verschelde
e0dc23367c
Remove now unused year member from version.py
We changed copyright to use "present" for the current year, so we no
longer need to hardcode this and (like now) forget to bump it yearly.
2024-01-25 15:08:34 +01:00
Rémi Verschelde
4db2a6801f
Merge pull request #85206 from bruvzg/mac_clang_version_check_update
[macOS] Check Apple specific version instead of generic clang version.
2024-01-18 16:33:39 +01:00
Alex Drozd
3f22c1bfb6 use venv if detected when building godot.sln 2023-11-26 23:25:13 +01:00
Max Hilbrunner
72110134d6 Fix generating vsproj with SCons 4.6.0+ 2023-11-25 21:27:18 +01:00
bruvzg
5201475f62
[macOS] Check Apple specific version instead of generic clang version. 2023-11-22 09:05:45 +02:00
Rémi Verschelde
495245ed89
SCons: Reduce and cleanup verbose output for SCU builds
Verbose output is meant for debugging the SCU mode itself and can be
triggered by changing the `_verbose` bool manually.

Prefix all prints with "SCU:" for context, and print the processed
folders all at once instead of when adding the sources.
2023-10-26 15:13:48 +02:00
bruvzg
89b568c2b0 Fix compiler detection. 2023-09-26 14:21:00 +03:00
Mario Liebisch
426e18fd37
Updated compiler version detection
This fixes multiple issues/inconsistencies around  `get_compiler_version()`:
* With no shell allocated, launching the compiler could fail even
  with proper paths being set.
* The return value was described as "an array of version numbers as ints",
  but the function actually returned a `Dictionary` (or `None`).
* Not all calls were properly handling a `None` return value in case of errors.
  On Windows this broke compiling for me since #81869 with default settings.
* Some calls defined inconsistent defaults/fallbacks (`0` or `-1`).
2023-09-25 21:17:20 +02:00
Rémi Verschelde
b362976504
SCons: Fix Python 3.12 SyntaxError with regex escape sequences 2023-09-25 10:39:30 +02:00
Valery Zhuk
6158578087 fix build options configuration for Visual Studio projects 2023-09-02 19:29:05 +03:00
ocean (they/them)
bbafe14970 Build system: add option for MSVC incremental linking. 2023-08-29 18:53:45 -04:00
Dario
cda4b4ebf3 Carry over the windows_subsystem setting to the generated vsproj if it's not the default.
Even if you specify the subsystem to be the console one, the vsproj doesn't carry over the setting, which makes working with this mode in the IDE a bit annoying since it'll regenerate the vsproj right afterwards. Since there's only two options and 'gui' is the default, we only carry over the 'console' setting.
2023-08-12 10:42:48 -03:00
Rémi Verschelde
90446fe9f3
SCons: Move platform logo/run icon to export folder
Follow-up to #75932.
Since these icons are only used by the export plugin, it makes sense to
move them and generate the headers there.

The whole `detect.is_active()` logic seems to be a leftover from before
times, as far back as 1.0-stable it already wasn't used for anything.

So I'm removing it and moving the export icon generation to
`platform_methods`, where it makes more sense.
2023-06-20 13:16:37 +02:00
Rémi Verschelde
c9c941e339
CI: Update static checks to black 23.3.0
And apply it to the codebase, removing empty lines at the start of blocks.
2023-06-19 23:33:02 +02:00
lawnjelly
6d0995b03d SCU build - Change options to "yes / no"
To save confusion for users who prefer yes / no, rather than none / dev / all.
2023-06-08 17:31:22 +01:00