Commit graph

8 commits

Author SHA1 Message Date
Rémi Verschelde c7b53c03ae
SCons: Add explicit dependencies on thirdparty code in cloned env
Since we clone the environments to build thirdparty code, we don't get an
explicit dependency on the build objects produced by that environment.

So when we update thirdparty code, Godot code using it is not necessarily
rebuilt (I think it is for changed headers, but not for changed .c/.cpp files),
which can lead to an invalid compilation output (linking old Godot .o files
with a newer, potentially ABI breaking version of thirdparty code).

This was only seen as really problematic with bullet updates (leading to
crashes when rebuilding Godot after a bullet update without cleaning .o files),
but it's safer to fix it everywhere, even if it's a LOT of hacky boilerplate.
2020-12-18 10:29:34 +01:00
Rémi Verschelde cd4e46ee65 SCons: Format buildsystem files with psf/black
Configured for a max line length of 120 characters.

psf/black is very opinionated and purposely doesn't leave much room for
configuration. The output is mostly OK so that should be fine for us,
but some things worth noting:

- Manually wrapped strings will be reflowed, so by using a line length
  of 120 for the sake of preserving readability for our long command
  calls, it also means that some manually wrapped strings are back on
  the same line and should be manually merged again.

- Code generators using string concatenation extensively look awful,
  since black puts each operand on a single line. We need to refactor
  these generators to use more pythonic string formatting, for which
  many options are available (`%`, `format` or f-strings).

- CI checks and a pre-commit hook will be added to ensure that future
  buildsystem changes are well-formatted.
2020-03-30 09:05:53 +02:00
Rémi Verschelde 5dae2ea777 SCons: Enable C++11 on the whole codebase
**Important:** This does not mean *yet* that C++11 features should be used
in contributions to Godot's codebase.

For now this change is done solely for feature branches working on Vulkan
support and GDScript typed instruction sets for Godot 4.0, which will both
use C++11 features and are based on the master branch.

The plan is to start porting the codebase to C++11 after Godot 3.2 is
released, following upcoming guidelines on the subset of new features that
should be used, and when/how to use them.

We will advertise clearly when C++11 contributions are open, especially
once we start a coordinated effort to port Godot's massive codebase. In the
meantime, please bear with us and good ol' C++03. :)
2019-07-22 17:17:30 +02:00
Rémi Verschelde d52b70fb5e SCons: Always use env.Prepend for CPPPATH
Include paths are processed from left to right, so we use Prepend to
ensure that paths to bundled thirdparty files will have precedence over
system paths (e.g. `/usr/include` should have lowest priority).
2019-04-30 13:12:06 +02:00
Rémi Verschelde eb155bc91a SCons: Clean xatlas SCsub from thekla/poshlib defines
Those are not used in xatlas.
2019-04-25 12:27:10 +02:00
Rémi Verschelde c2a669a9f0 SCons: Review uses of CCFLAGS, CXXFLAGS and CPPFLAGS
Many contributors (me included) did not fully understand what CCFLAGS,
CXXFLAGS and CPPFLAGS refer to exactly, and were thus not using them
in the way they are intended to be.

As per the SCons manual: https://www.scons.org/doc/HTML/scons-user/apa.html

- CCFLAGS: General options that are passed to the C and C++ compilers.
- CFLAGS: General options that are passed to the C compiler (C only;
  not C++).
- CXXFLAGS: General options that are passed to the C++ compiler. By
  default, this includes the value of $CCFLAGS, so that setting
  $CCFLAGS affects both C and C++ compilation.
- CPPFLAGS: User-specified C preprocessor options. These will be
  included in any command that uses the C preprocessor, including not
  just compilation of C and C++ source files [...], but also [...]
  Fortran [...] and [...] assembly language source file[s].

TL;DR: Compiler options go to CCFLAGS, unless they must be restricted
to either C (CFLAGS) or C++ (CXXFLAGS). Preprocessor defines go to
CPPFLAGS.
2019-04-24 16:57:58 +02:00
Mikko Mustonen 8d31aba24e Fix inconsistent use of tabs and spaces in indentation 2018-09-29 18:03:56 +03:00
Juan Linietsky 6cbdeedf57 Added xatlas as alternative to thekla, forced it on.
Did some hacks to it to avoid it from failing on bad geometry.
2018-09-29 09:46:26 -03:00