Commit Graph

103 Commits (6884ca9be0ed9c50bc1b46e5c68d963aecb2a9eb)

Author SHA1 Message Date
Adam Scott f8054cca80 Add support to import custom variables from parent SConstruct (redux)
(cherry picked from commit 982e01ec7f)
2023-10-09 08:42:43 -05:00
DmitriySalnikov dd8e1def67 [SCons] Fixed crashes in several scripts
(cherry picked from commit 0e5975dd26)
2023-09-19 21:23:20 -05:00
Fabio Alessandrelli 63755b2a32 [SCons] Move the GodotCPP build to its own tool.
(cherry picked from commit f8b4f60cb9)
2023-09-01 17:07:53 -05:00
Fabio Alessandrelli 784c3dc012 [SCons] Add option to generate a compilation database.
(cherry picked from commit 2586ad016e)
2023-08-10 09:09:30 -05:00
Adam Scott 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
Trey Moller 6f7e80bbb6
Prepend PATH to scons env 2023-06-14 10:30:24 -05:00
Rémi Verschelde 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
Ricardo Buring 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
Fabio Alessandrelli 6877a0abcd [SCons] Fix custom API file/dir relative paths. 2023-01-09 21:09:49 +01:00
Fabio Alessandrelli 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
Rémi Verschelde 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
Gilles Roudière 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
Fabio Alessandrelli 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
Rémi Verschelde bef1fa091c
Merge pull request #835 from Faless/build/4.x_opt_debug 2022-09-19 15:11:05 +02:00
Emilien Bauer 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
Fabio Alessandrelli 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
bruvzg 0ee980abae
Rename OSX to macOS. 2022-07-20 11:01:47 +03:00
Rémi Verschelde 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
Fabio Alessandrelli 7901986dcf [SCons] Fix msvc, linux-clang, add version check. 2022-07-04 18:00:29 +02:00
Fabio Alessandrelli 93f2091185 [SCons] Move toolchains logic to tools folder. 2022-06-27 20:44:12 +02:00
Fabio Alessandrelli b8ae658981 [SCons] Fix Android builds with modern NDKs. 2022-06-15 00:00:36 +02:00
Aaron Franke 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
Fabio Alessandrelli 24e4aeb2c6
Merge pull request #746 from NicholasShatokhin/master
Build javascript target on windows host
2022-05-04 15:59:36 +02:00
bruvzg e06d5cd414
Add double precision build support. 2022-05-04 15:56:35 +03:00
Fabio Alessandrelli 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
Fabio Alessandrelli 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
Mykola Shatokhin b2331e1f6d Build javascript target on windows host 2022-05-01 00:35:42 +03:00
Aaron Franke 101d61b64a
[master] Run black format on SConstruct files and bindings generator 2022-02-26 15:04:11 -06:00
bruvzg 3bb86f1e01
Use C++17 flag only for C++ files. 2022-02-16 13:12:10 +02:00
bruvzg b6b64bcd70
[macOS] Restore demo library output names. 2022-02-14 08:57:35 +02:00
Fabio Alessandrelli f5172016b8 [Build] Fix exposed suffix, remove unused option. 2022-02-10 07:36:26 +01:00
Fabio Alessandrelli 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
Fabio Alessandrelli cf3fcab6b4 Always require C++17. Shuold fix other platforms. 2022-02-10 00:19:01 +01:00
Gilles Roudière 3fcb8a4d1e Make extension instances create the corresponding godot object in their constructor 2021-12-03 15:37:49 +01:00
Hugo Locurcio 1e2eafe777
Print a warning with unknown SCons variables to ease troubleshooting 2021-11-23 22:41:52 +01:00
Fabio Alessandrelli 67f9109d1f [OSX] Add universal build support. 2021-09-29 22:31:12 +02:00
Bastiaan Olij 68ebc9b2a8 Changed over to proper godot-headers 2021-09-27 23:08:12 +10:00
Bastiaan Olij 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
George Marques 8bcf32a619 Fix issues with method calls 2021-09-27 23:08:08 +10:00
George Marques e4ed48976a Replace bindgins to work with extensions 2021-09-27 23:08:08 +10:00
Rémi Verschelde 228014bec8
Merge pull request #547 from piiertho/hotfix/add-android-missing-toolchain-elements 2021-09-27 11:42:39 +02:00
Fabio Alessandrelli 1db7630d01 Fix OSX library name for arm64.
Was always `.64`, it's now `.arm64` for M1.
2021-07-10 19:02:52 +02:00
Fabio Alessandrelli e08ecdc28c
Merge pull request #584 from Faless/build/osx_arm64
Add OSX arm64 build target.
2021-07-09 16:03:49 +02:00
Fabio Alessandrelli 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
Fabio Alessandrelli 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
Fabio Alessandrelli e5279d3d0f Add optimization flags for android and javascript. 2021-07-05 15:53:52 +02:00
Fabio Alessandrelli 26d4df4e17 Fix JavaScript library suffix.
Also add `.bc` files to `.gitignore`
2021-07-05 15:47:49 +02:00
Pierre-Thomas Meisels f579039a0a Fix: add missing toolchain elements for android 2021-04-25 21:24:38 +02:00
Fabio Alessandrelli f6899e190f Add JavaScript platform support (emcc, wasm).
Includes update to `README.md` with instructions on how to build a
GDNative library for webassembly.
2021-03-11 05:11:13 +01:00
George Marques cee79bb7a6
Merge pull request #517 from SeleDreams/master
Added freebsd specific configuration to SConstruct
2021-03-01 11:56:37 -03:00