108 Commits

Author SHA1 Message Date
6a870949a5 Merge pull request #1669 from Ivorforce/scons-variant_dir-support
Add SCons variant_dir support
2025-07-03 12:17:32 -05:00
64cdf089d9 CI: Various version bumps; sync with main repo 2025-04-26 12:23:07 -05:00
1345c46650 Add SCons variant_dir support, which allows specifying a target build directory. 2025-01-12 18:32:59 +01:00
e0d363aad8 Integrate .pre-commit-config.yaml 2024-06-24 15:43:55 -05:00
381df0081a Merge pull request #1220 from adamscott/add-local-custom-support-redux
Add support to import custom variables from parent SConstruct (redux)
2023-09-21 15:06:30 -05:00
0e5975dd26 [SCons] Fixed crashes in several scripts 2023-09-09 12:44:14 +03:00
982e01ec7f Add support to import custom variables from parent SConstruct (redux) 2023-09-04 15:05:52 -04:00
f8b4f60cb9 [SCons] Move the GodotCPP build to its own tool. 2023-08-29 18:14:42 +02:00
2586ad016e [SCons] Add option to generate a compilation database. 2023-07-22 20:04:30 +02:00
8155f35b29 Import env if possible
This PR make it possible to import `env` and use it instead of creating
one from scratch every time.

Handy because we encourage users to use the godot-cpp SConstruct file as
a base to their projects (see the test project). So, if a project want
to override specific settings, (eg. make a path local to their SConstruct
file, not local to the godot-cpp/SConstruct file), it can do so.
2023-07-11 04:41:55 -04:00
6f7e80bbb6 Prepend PATH to scons env 2023-06-14 10:30:24 -05:00
2b7094f342 Merge pull request #988 from rburing/precision=double
Rename `float=64` build option to `precision=double`
2023-01-10 16:09:02 +01:00
47140cdad0 Rename float=64 build option to precision=double
This makes the build system consistent with Godot again.
Also fix CMake build to define REAL_T_IS_DOUBLE when precision=double.
2023-01-09 23:22:03 +01:00
6877a0abcd [SCons] Fix custom API file/dir relative paths. 2023-01-09 21:09:49 +01:00
8d6982be3b [SCons] Platform agnostic default toolchain (GNU).
Create the SCons Environment with an empty PLATFORM variable to force
the default tools to use the GNU toolchain.

Platform specific toolchains are then setup in our custom tools.
2022-12-20 17:41:34 +01:00
bab247dcb6 Rename godot-headers to gdextension, move header to top folder
Changes the `<godot/gdextension_interface.h>` include to simply
`<gdextension_interface.h>`.

Refactor and better document the SCons and CMake logic around setting
the paths to the header and API JSON file.
2022-12-14 12:36:59 +01:00
c02e644679 Rename GDNative to GDExtension
Non-exhaustive list of case-sensitive renames:

GDExtension -> GDNative
GDNATIVE -> GDEXTENSION
gdextension -> gdnative
ExtensionExtension -> Extension (for where there was GDNativeExtension)
EXTENSION_EXTENSION -> EXTENSION (for where there was GDNATIVE_EXTENSION)
gdnlib -> gdextension
gdn_interface -> gde_interface
gdni -> gde_interface
2022-12-12 11:06:38 +01:00
64b2c9be0b [SCons] Refactor targets, symbols, optimizations.
Now matches Godot `master` target names and supports the same flags with
the following notable exceptions:
- The default target is "template_debug", since it's compatible with
  editor builds (and TOOLS_ENABLED is never used internally).
- separate_debug_symbols is still not supported, and will be done in a
  separate commit.
2022-10-04 16:05:40 +02:00
bef1fa091c Merge pull request #835 from Faless/build/4.x_opt_debug 2022-09-19 15:11:05 +02:00
8e717acf48 Add options to use scons caching for faster iteration.
Sort the sets in source generation so they are generated consistently between runs; otherwise caching is useless.
2022-09-19 13:32:23 +02:00
2bf983e638 [SCons] Add "optimize" and "debug_symbols" options
optimize = auto|none|debug|speed|size|0|1|2|3
debug_symbol = True|False

optimize == "auto" will produce:
- "debug" for "debug" builds
- "speed" for "release" builds
2022-09-12 16:52:05 +02:00
0ee980abae Rename OSX to macOS. 2022-07-20 11:01:47 +03:00
cdcd473371 SCons: Default num_jobs to max CPUs minus 1 if not specified
This doesn't change the behavior when `--jobs`/`-j` is specified as a
command-line argument or in `SCONSFLAGS`.

The SCons hack used to know if `num_jobs` was set by the user is derived
from the MongoDB setup.

We use `os.cpu_count()` for portability (available since Python 3.4).

With 4 CPUs or less, we use the max. With more than 4 we use max - 1 to
preserve some bandwidth for the user's other programs.
2022-07-17 12:37:13 +02:00
7901986dcf [SCons] Fix msvc, linux-clang, add version check. 2022-07-04 18:00:29 +02:00
93f2091185 [SCons] Move toolchains logic to tools folder. 2022-06-27 20:44:12 +02:00
b8ae658981 [SCons] Fix Android builds with modern NDKs. 2022-06-15 00:00:36 +02:00
e5c4351bc7 Unify bits, android_arch, macos_arch ios_arch into arch, support non-x86
Unify arguments and add support for ARM64 and RV64 Linux
2022-06-01 13:00:25 -05:00
24e4aeb2c6 Merge pull request #746 from NicholasShatokhin/master
Build javascript target on windows host
2022-05-04 15:59:36 +02:00
e06d5cd414 Add double precision build support. 2022-05-04 15:56:35 +03:00
fa698ddd12 [Scons] Use builder to track bindings regeneration.
Using a scons Builder we now regenerate the bindings automatically
when the Godot API json or header has changed.

The option to force bindings regeneration (generate_bindings=yes) is
retained.
2022-05-03 10:48:23 +02:00
b47dfb6a5c [CI] Add python file format to static checks.
Uses the same version of `black` as godot.
2022-05-02 21:13:56 +02:00
b2331e1f6d Build javascript target on windows host 2022-05-01 00:35:42 +03:00
101d61b64a [master] Run black format on SConstruct files and bindings generator 2022-02-26 15:04:11 -06:00
3bb86f1e01 Use C++17 flag only for C++ files. 2022-02-16 13:12:10 +02:00
b6b64bcd70 [macOS] Restore demo library output names. 2022-02-14 08:57:35 +02:00
f5172016b8 [Build] Fix exposed suffix, remove unused option. 2022-02-10 07:36:26 +01:00
dcc52f4321 Library SCons boilerplate to build projects.
Works by executing project `SConstruct`s file in a cloned env (a bit
like Godot does for modules) so you don't have to worry about platform
and toolchain setup.

Convert the project test file to work as submodule, add it to CI

Run with:

```
scons build_projects=test,/path/to/other/project
```
2022-02-10 01:44:48 +01:00
cf3fcab6b4 Always require C++17. Shuold fix other platforms. 2022-02-10 00:19:01 +01:00
3fcb8a4d1e Make extension instances create the corresponding godot object in their constructor 2021-12-03 15:37:49 +01:00
1e2eafe777 Print a warning with unknown SCons variables to ease troubleshooting 2021-11-23 22:41:52 +01:00
67f9109d1f [OSX] Add universal build support. 2021-09-29 22:31:12 +02:00
68ebc9b2a8 Changed over to proper godot-headers 2021-09-27 23:08:12 +10:00
df9164b9bd Added TYPED_METHOD_BIND and c++17 flags to windows build and moved test project files 2021-09-27 23:08:09 +10:00
8bcf32a619 Fix issues with method calls 2021-09-27 23:08:08 +10:00
e4ed48976a Replace bindgins to work with extensions 2021-09-27 23:08:08 +10:00
228014bec8 Merge pull request #547 from piiertho/hotfix/add-android-missing-toolchain-elements 2021-09-27 11:42:39 +02:00
1db7630d01 Fix OSX library name for arm64.
Was always `.64`, it's now `.arm64` for M1.
2021-07-10 19:02:52 +02:00
e08ecdc28c Merge pull request #584 from Faless/build/osx_arm64
Add OSX arm64 build target.
2021-07-09 16:03:49 +02:00
784103f676 Merge pull request #581 from Faless/build/optimization_flags
Add optimization flags for android and javascript.
2021-07-09 16:01:47 +02:00
5b8bcb7164 Add OSX arm64 build target.
New "macos_arch" to specify the desired arch, and "macos_sdk_path" to
override the default SDK path.
2021-07-07 11:08:33 +02:00