summaryrefslogtreecommitdiff
path: root/SConstruct
AgeCommit message (Collapse)Author
2019-12-11SCons: Add 'split_libmodules' option to workaround linker issueRémi Verschelde
The new 'split_libmodules=yes' option is useful to work around linker command line size limitations when linking a huge number of objects. We're currently over 64k chars when linking libmodules.a on Windows with MinGW, which triggers issues as seen in #30892. Even on Linux, we can also reach linker command line size limitations by adding more custom modules. We force this option to True for MinGW on Windows, which fixes #30892. Additional changes to lib splitting: - Fix linking of the split module libs with interdependent symbols, hacking our way into LINKCOM and SHLINKCOM to set the `--start-group` and `--end-group` flags. - Fix Python 3 compatibility in `methods.split_lib()`. - Drop seemingly obsolete condition for 'msys' on 'posix'. - Drop the unnecessary 'split_drivers' as the drivers lib is no longer too big since we moved all thirdparty builds to modules. Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
2019-11-20pcre2: Use scons option to disable JIT on some platformsRémi Verschelde
Third-party platforms (e.g. console ports) need to be able to disable JIT support in the regex module too, so it can't be hardcoded in the module SCsub. This is cleaner this way anyway. Fixes #19316.
2019-10-10Remove dependency on the editor directory being in the build's include path.Marcel Admiraal
- Add or remove the necessary subdirectorires to the includes to remove dependency on the editor directory being in the build's include path. - Ensure includes in modified files conform to style guideline. - Remove editor from the build include path.
2019-08-11Prevent editor compilation with regex module disabled, which is not supportedPouleyKetchoupp
2019-07-22SCons: Enable C++11 on the whole codebaseRémi Verschelde
**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-17Add a `platform=list` SCons argument to list platformsHugo Locurcio
This also improves the message display and makes an invalid selection exit with a non-zero status code.
2019-07-04Remove libwebsocket. No longer used, yay!Fabio Alessandrelli
2019-06-28Add support for creating editor icons per moduleAndrii Doroshenko (Xrayez)
The functionality is similar to how `doc_classes` are retrieved per module. The build system will search for custom icons path defined per module via `get_icons_path()` method in `config.py` or default icons path. If such paths don't exist, only the editor's own icons will be built. Most module icons were moved from editor/icons to respective modules.
2019-06-20SCons: Enable -Wclobbered in warnings=extra for GCCRémi Verschelde
2019-06-19Enforce Unicode encoding in MSVCAndrii Doroshenko (Xrayez)
This can help to solve compilation issues on systems with Japanese locale with encodings like Shift_JIS and UTF-8-BOM. Also be more consistent using String::utf8() to represent cyrilic unicode characters in test_string.cpp Clarified some comments in test_string.cpp for some Unicode characters.
2019-06-15SCons: Enable -Werror and -Wextra in 'dev' build optionRémi Verschelde
We're close to being able to compile all platforms with -Werror -Wextra, so it's best if developers use those options when compiling their code as those checks are also done on CI. Also enabled -Wduplicated-branches on GCC.
2019-05-27Fix SCons automatic platform detection on LinuxHugo Locurcio
2019-05-27Merge pull request #29199 from mhilbrunner/no-platform-no-moreRémi Verschelde
Scons: Fix .editorconfig, autodetect platform argument if missing
2019-05-26Fixed typo in SConstructdankan1890
2019-05-26Scons: Autodetect platform if not specifiedMax Hilbrunner
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2019-05-19Fix typos with codespellRémi Verschelde
Using codespell 1.15.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang curvelinear doubleclick leapyear lod merchantibility nd numer ois ony que seeked synching te uint unselect webp EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
2019-05-02Ignore a warning in _get_socket_error (-Wlogical-op).marxin
drivers/unix/net_socket_posix.cpp: In member function 'NetSocketPosix::NetError NetSocketPosix::_get_socket_error()': drivers/unix/net_socket_posix.cpp:197:22: warning: logical 'or' of equal expressions [-Wlogical-op] 197 | if (errno == EAGAIN || errno == EWOULDBLOCK) | ^ and: modules/mono/utils/string_utils.cpp: In function 'int {anonymous}::sfind(const String&, int)': modules/mono/utils/string_utils.cpp:68:48: error: logical 'or' of collectively exhaustive tests is always true [-Werror=logical-op] found = src[read_pos] == 's' || (c >= '0' || c <= '4'); ~~~~~~~~~^~~~~~~~~~~
2019-04-30SCons: Always use env.Prepend for CPPPATHRémi Verschelde
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-24SCons: Review uses of CCFLAGS, CXXFLAGS and CPPFLAGSRémi Verschelde
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-07Android now (optionally) builds the template when exportingJuan Linietsky
Added new way to create add-ons Removed old way to create add-ons
2019-04-23Merge pull request #27868 from marxin/add-more-warningsHein-Pieter van Braam
Add more warnings on top of -Wall and -Wextra.
2019-04-19Drop unused thekla_atlas dependencyRémi Verschelde
Since f12cb82 @reduz dropped the use of the thirdparty thekla_atlas library, which is replaced by xatlas. Fixes #28180. Fixes #28182.
2019-04-10Add more warnings on top of -Wall and -Wextra.marxin
2019-04-06Remove unused importsHendrikto
2019-04-05Fix -Wimplicit-fallthrough warnings from GCC 8Rémi Verschelde
Adds `FALLTHROUGH` macro to specify when a fallthrough is intentional. Can be replaced by `[[fallthrough]]` if/when we switch to C++17. The warning is now enabled by default for GCC on `extra` warnings level (part of GCC's `-Wextra`). It's not enabled in Clang's `-Wextra` yet, but we could enable it manually once we switch to C++11. There's no equivalent feature in MSVC for now. Fixes #26135.
2019-04-05SCons: add `methods.using_clang` to check used compilerRémi Verschelde
Also rename `use_gcc` to `using_gcc` to make it clear that it returns a config but does not alter it.
2019-04-02Enable warnings=extra on clang and GCC testers.marxin
And remove 2 warnings from warnings=extra.
2019-02-27Fix -Wsign-compare warnings.marxin
I decided to modify code in a defensive way. Ideally functions like size() or length() should return an unsigned type.
2019-02-25Several fixes to make GLES2 on HTML5 work much better.Juan Linietsky
Changed math class error reporting to be a bit less paranoid.
2019-02-25Merge pull request #26160 from marxin/come-up-with-use_gccHein-Pieter van Braam
Come up with use_gcc.
2019-02-23Come up with use_gcc.marxin
Add new method. Fix wrong version condition for -fpie.
2019-02-23Add -Wwrite-strings into all and extra warnings.marxin
2019-02-20Add -Wshadow=local to warnings and fix reported issues.marxin
Fixes #25316.
2019-02-10Merge pull request #25764 from akien-mga/scons-relative-importRémi Verschelde
SCons: Fix import clash between Godot and system modules
2019-02-10SCons: Fix import clash between Godot and system modulesRémi Verschelde
See #24965 for details. `sys.path.insert` is hacky, but should work relatively well for both Python 2 and Python 3. When we eventually deprecate Python 2 support, we could look into using importlib. Fixes #24965.
2019-02-10SCons: Make MD5-timestamp decider and implicit_cache debug-onlyRémi Verschelde
As advised by @bdbaddog in #25403, those options reduce the certainty that all everything will be rebuilt as it should, so they are not advised for release builds.
2018-12-21Fix possible error in "disable_advanced_gui" flag's descriptionMichael Alexsander Silva Dias
2018-12-20Core: Drop unused global_defaults logicRémi Verschelde
It used to be used for Android and iOS to specify platform-specific project settings overrides, but we now have feature tags for that.
2018-11-18SCons: Corrects $LIBSUFFIXES environment variable for WindowsErik
Maxes only .lib to be recoginzed as a valid input extension for linker on Windows. Closes issue #23769.
2018-10-29Merge pull request #23279 from marcelofg55/osx_serverRémi Verschelde
Server platform works on OS X too
2018-10-29Server platform works on OS X tooMarcelo Fernandez
2018-10-27Dont use equality operators with None singleton in python fileslupoDharkael
2018-10-04SCons: Add 'werror' opt-in to treat warning as errorsRémi Verschelde
Also reorder advanced options to a more natural order, and fix MSVC warning when disabling warnings in secondary environment.
2018-10-04SCons: Set default warnings level to all (-Wall or /W3)Rémi Verschelde
2018-10-03Fix some warnings raised by MSVC 2017Rémi Verschelde
Disabled signed/unsigned warnings like for GCC/Clang (warning C4018: '>=': signed/unsigned mismatch). Fixes the following MSVC 2017 warnings: ``` core\image.cpp(999): warning C4804: '>': unsafe use of type 'bool' in operation core\io\compression.cpp(178): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) editor\doc\doc_dump.cpp(226): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) scene/resources/material.h(289): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) scene/resources/material.h(298): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) editor\editor_themes.cpp(379): warning C4805: '==': unsafe mix of type 'int' and type 'bool' in operation ```
2018-10-02Disable forced inline when building in debug.Juan Linietsky
2018-10-01SCons: Remove avoidable defines from main env's CPPPATHRémi Verschelde
Also finally move freetype to its own env and disable warnings for it. Still needs some work to fix the awkward situation of the freetype and svg modules used in scene/ and editor/ respectively.
2018-09-29Added xatlas as alternative to thekla, forced it on.Juan Linietsky
Did some hacks to it to avoid it from failing on bad geometry.
2018-09-28SCons: Build thirdparty code in own env, disable warningsRémi Verschelde
Also remove unnecessary `Export('env')` in other SCsubs, Export should only be used when exporting *new* objects.
2018-09-27Fix warnings for comparison between signed and unsigned integers ↵Rémi Verschelde
[-Wsign-compare] Also turn off -Wsign-compare warnings in the future, we do not consider them important. Fixes the following GCC 5 warnings: ``` core/node_path.cpp:279:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] core/oa_hash_map.h:169:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] core/oa_hash_map.h:314:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] drivers/gles2/shader_gles2.cpp:985:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] drivers/gles3/rasterizer_storage_gles3.cpp:1075:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] drivers/pulseaudio/audio_driver_pulseaudio.cpp:343:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] editor/editor_plugin.cpp:525:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] editor/editor_properties_array_dict.cpp:747:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] editor/plugins/spatial_editor_plugin.cpp:2078:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] editor/plugins/spatial_editor_plugin.cpp:4096:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] editor/plugins/sprite_editor_plugin.cpp:100:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/cvtt/image_compress_cvtt.cpp:122:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/cvtt/image_compress_cvtt.cpp:134:77: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/cvtt/image_compress_cvtt.cpp:339:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/etc/image_etc.cpp:222:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/gdnative/register_types.cpp:242:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/gdnative/register_types.cpp:258:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/opensimplex/simplex_noise.cpp:200:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/opensimplex/simplex_noise.cpp:222:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] modules/opensimplex/simplex_noise.cpp:246:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] platform/android/export/export.cpp:1085:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] platform/android/export/export.cpp:1489:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] platform/android/export/export.cpp:1623:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] platform/iphone/export/export.cpp:206:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] platform/iphone/export/export.cpp:356:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] platform/iphone/export/export.cpp:406:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] platform/iphone/export/export.cpp:493:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] scene/3d/audio_stream_player_3d.cpp:420:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] scene/resources/audio_stream_sample.cpp:565:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] scene/resources/audio_stream_sample.cpp:571:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] servers/audio/audio_rb_resampler.cpp:156:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ``` The following warnings were not fixed, as they implied casting for no gain: ``` core/io/packet_peer.cpp:228:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] core/io/resource_format_binary.cpp:109:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] drivers/gles2/rasterizer_scene_gles2.cpp:144:57: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] drivers/unix/file_access_unix.cpp:249:46: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] scene/3d/voxel_light_baker.cpp:889:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] scene/3d/voxel_light_baker.cpp:1020:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] scene/3d/voxel_light_baker.cpp:1154:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] scene/3d/voxel_light_baker.cpp:2255:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] scene/resources/bit_mask.cpp:336:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] servers/audio/audio_stream.cpp:141:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] servers/audio/audio_stream.cpp:150:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] servers/audio/audio_stream.cpp:154:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] servers/audio_server.cpp:86:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] servers/audio_server.cpp:89:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ```