Commit Graph

36 Commits (32becf6a13681119ad63b6d7cc4e816c9a0cc86b)

Author SHA1 Message Date
Thaddeus Crews 28a6609c0b Implement `verbose` toggle from godot repo
(cherry picked from commit b05c21bb1d)
2024-04-17 10:58:41 -05:00
Fabio Alessandrelli 670c4d0eac [SCons] Split `targets.py`, apply flags from tools
Split `targets` tool logic, moving all the compiler-specific flags to a
new `common_compiler_flags.py` file, and everything else (CPPDEFINES,
optimize option logic, dev build logic, etc) to the `godotcpp` tool.

The default tools now apply the common compiler flags by importing the
file and explicitly calling `configure`.

(cherry picked from commit 16df4bff30)
2024-03-11 13:06:57 -05:00
Fabio Alessandrelli bab62a4d72 [SCons] Add support for custom build tools and platforms
Use with:

`scons platform=os2 custom_tools=/path/to/tools`

(assuming you have an `os2.py` inside `/path/to/tools/`)

(cherry picked from commit baaad7ada2)
2024-03-11 13:01:23 -05:00
David Snopek 4b63d795e4
Merge pull request #1373 from dsnopek/4.1-cherrypicks-7
Cherry-picks for the godot-cpp 4.1 branch - 7th batch
2024-02-16 09:37:17 -06:00
ArchLinus 82475b215b Add an error message if android NDK is not installed
(cherry picked from commit 718d0baea3)
2024-01-22 15:53:49 -06:00
Aaron Franke 49098fbdc7 Allow detecting when building as a GDExtension
(cherry picked from commit e17c7bf530)
2024-01-22 15:53:49 -06:00
DmitriySalnikov 51aeda7437 [Scons] Set the minimum Android API level to 21
(cherry picked from commit 79d2a9c456)
2024-01-22 15:53:49 -06:00
Thaddeus Crews a1ae58448c fix is_msvc and use_hot_reload variables
(cherry picked from commit 648b8c4489)
2023-11-13 13:00:24 -06:00
Fredia Huya-Kouadio 29335d8f5c Update the environment variables used to access the Android NDK toolchain
(cherry picked from commit 86dbd5fa0d)
2023-11-13 13:00:24 -06:00
Rémi Verschelde ef8a499eac SCons: Disable C++ exception handling by default
Counterpart to https://github.com/godotengine/godot/pull/80612.

(cherry picked from commit bf1c03ab5f)
2023-10-23 10:10:59 -05:00
Adam Scott 8295486fdb Refactor compiledb implementation
This comment enables the possibility to build the "compile_commands.json"
file by only using `scons -Q compiledb`. No need to use the argument
`compiledb=yes`.

And when using the `compiledb=yes`, it will create a
"compiled_commands.json" automatically.

(cherry picked from commit 2d5024ac8e)
2023-10-22 14:46:58 -05:00
Thaddeus Crews 7704a9d054 Let gdextension_dir function as only argument
(cherry picked from commit 7a5cbcac21)
2023-10-22 14:46:48 -05:00
Fabio Alessandrelli 62cb5eac47 [SCons] Rename javascript tool to web
And clean it up a bit.

(cherry picked from commit 18bfa133ab)
2023-10-22 14:03:20 -05:00
Nick Maltbie 0b1c8bcac3 Added fix for javascript build for godot 4.x
Added changes to tools/javascript.py to add PFlags to fix SharedArrayBuffer memory error.
Corrected some small errors in tools/javascript.py to support new target names.
Also updated ci to include validation for web build.

(cherry picked from commit 2b4bcbb0ce)
2023-10-09 08:43:36 -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
Rémi Verschelde 738ef9baf8 SCons: Sync `targets.py` fully with upstream Godot
- Reorders existing code to match Godot.
- Adds `NDEBUG` for non-dev builds.
- Adds `-gdwarf-4` for Clang debug symbols.
- Adds strip link flag for GCC/Clang builds without debug symbols.

(cherry picked from commit 600e749d9b)
2023-09-01 17:07:03 -05:00
Feiyun Wang 4fb9af7fb2 Statically link mingw/msvc runtime libraries on Windows
Co-authored-by: David Snopek <dsnopek@gmail.com>
(cherry picked from commit a745c2ac47)
2023-08-10 09:10:04 -05:00
Fabio Alessandrelli 6fa6b8b178 [SCons] Merge OSXCross tools into platofrm ones
(cherry picked from commit 6d195137fe)
2023-08-10 09:09:49 -05:00
Adam Scott 7a9b323931 Add platform macros
(cherry picked from commit 9d9f4279ed)
2023-08-10 09:09:14 -05:00
bruvzg d1aeba771a
[MSVC] Force UTF-8 encoding. 2023-07-11 16:11:51 +03: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
Fabio Alessandrelli edf02f8319 [SCons] Link MSVC debug runtime for optimize=none|debug only.
Select windows runtime in "targets" tool, use "/MDd" flag only when
building with optimize="none" and optimize="debug".
2022-11-21 11:04:10 +01:00
bruvzg 6e7a24d390
Fix Android build on macOS. 2022-11-10 15:20:15 +02:00
Fabio Alessandrelli 35ec1403dc [SCons] Remove bogus CCFLAGS from windows toolchain.
The c++ standard is added as part of the main SConstruct
2022-11-02 16:45: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
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
Fabio Alessandrelli 081d425277 [MSVC] Add NOMINMAX flag to scons and cmake.
Ensures user inclusion of windows.h do not define "min" and "max"
macros.
2022-09-12 13:12:55 +02:00
Kevin Smith 7f44a1b44e Add debug information to Windows builds
Previously, Windows builds were being produced without debug
information, leading to somewhat unhelpful backtraces etc.
without symbols.

This builds the symbols in (only for debug builds - I've
deliberately not touched release builds here) so gdextension
bugs are a little more tractable.

Test-Information:
Have been running this patch for weeks, and getting useful
traces out on the commandline, and useful debugging from
debuggers.
2022-07-28 20:37:44 +01:00
Fabio Alessandrelli 0943dfc34a [CI] Fix Android builds after GH container update. 2022-07-28 06:30:04 +02:00
bruvzg 0ee980abae
Rename OSX to macOS. 2022-07-20 11:01:47 +03:00
Kevin Smith b038fe556b Add clang-cl support
Visual C++ has a clang-based driver, available through the
clang-cl wrapper (which provides the same interface as
cl) - this generates objects binary-compatible with the
default (traditional) driver, and can then be linked in
the normal way. As such, this patch simply configures for
MSVCC and then overwrites the cl compiler with clang-cl
in the environment.

Clang gives (subjectively) much more understandable compiler warnings
and errors than MSVCC, which was my motivation for switching.

Test-Information:
Builds for me with VS2022, and my gdextension library
builds and links.
2022-07-12 18:13:25 +01:00
Fabio Alessandrelli 7901986dcf [SCons] Fix msvc, linux-clang, add version check. 2022-07-04 18:00:29 +02:00
Fabio Alessandrelli 7850785ccb [SCons] Add iOS OSXCross support, min version override. 2022-06-27 20:44:12 +02:00
Fabio Alessandrelli 8dbfe03d17 [SCons] Add OSXCross tool. 2022-06-27 20:44:12 +02:00
Fabio Alessandrelli 93f2091185 [SCons] Move toolchains logic to tools folder. 2022-06-27 20:44:12 +02:00