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.
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.
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.