Commit Graph

21 Commits (014132d4c03290448d214d22a07e1f84fdd931c6)

Author SHA1 Message Date
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