summaryrefslogtreecommitdiff
path: root/editor/SCsub
AgeCommit message (Collapse)Author
2023-02-07Prepare for moving editor and classref translations to godot-editor-l10n repoHaoyu Qiu
- Separate editor interface and property translations. - Add property translation in TranslationServer. - The split and merge of the POT/PO/Makefiles and extract scripts is done directly in godot-editor-l10n, the files will be removed in the next commit. - Remove the hardcoded "to_include" lists from the SCsub, we'll only commit the files which are ready to inclue.
2022-09-26SCons: Unify tools/target build type configurationRémi Verschelde
Implements https://github.com/godotengine/godot-proposals/issues/3371. New `target` presets ==================== The `tools` option is removed and `target` changes to use three new presets, which match the builds users are familiar with. These targets control the default optimization level and enable editor-specific and debugging code: - `editor`: Replaces `tools=yes target=release_debug`. * Defines: `TOOLS_ENABLED`, `DEBUG_ENABLED`, `-O2`/`/O2` - `template_debug`: Replaces `tools=no target=release_debug`. * Defines: `DEBUG_ENABLED`, `-O2`/`/O2` - `template_release`: Replaces `tools=no target=release`. * Defines: `-O3`/`/O2` New `dev_build` option ====================== The previous `target=debug` is now replaced by a separate `dev_build=yes` option, which can be used in combination with either of the three targets, and changes the following: - `dev_build`: Defines `DEV_ENABLED`, disables optimization (`-O0`/`/0d`), enables generating debug symbols, does not define `NDEBUG` so `assert()` works in thirdparty libraries, adds a `.dev` suffix to the binary name. Note: Unlike previously, `dev_build` defaults to off so that users who compile Godot from source get an optimized and small build by default. Engine contributors should now set `dev_build=yes` in their build scripts or IDE configuration manually. Changed binary names ==================== The name of generated binaries and object files are changed too, to follow this format: `godot.<platform>.<target>[.dev][.double].<arch>[.<extra_suffix>][.<ext>]` For example: - `godot.linuxbsd.editor.dev.arm64` - `godot.windows.template_release.double.x86_64.mono.exe` Be sure to update your links/scripts/IDE config accordingly. More flexible `optimize` and `debug_symbols` options ==================================================== The optimization level and whether to generate debug symbols can be further specified with the `optimize` and `debug_symbols` options. So the default values listed above for the various `target` and `dev_build` combinations are indicative and can be replaced when compiling, e.g.: `scons p=linuxbsd target=template_debug dev_build=yes optimize=debug` will make a "debug" export template with dev-only code enabled, `-Og` optimization level for GCC/Clang, and debug symbols. Perfect for debugging complex crashes at runtime in an exported project.
2022-07-27i18n: Sync editor translations with WeblateRémi Verschelde
(cherry picked from commit 5e66d2e2c4103ba4c7d178409da2a721bcb6d842)
2022-07-26Split up editor export code into multiple filesAaron Franke
2022-04-25i18n: Sync editor translations with WeblateRémi Verschelde
(cherry picked from commit 1e61fb1e37c537179e3d50ad21ff26776a3ebb7e)
2022-03-25Convert the editor and default theme fonts to WOFF2 format to save space.bruvzg
2022-03-09i18n: Sync editor translations with WeblateRémi Verschelde
(cherry picked from commit 751769ed45f835e96eedb7cf1aa47733b342d969)
2021-11-03i18n: Sync classref translations with WeblateRémi Verschelde
German (de) is now above the threshold for inclusion. (cherry picked from commit 0b694eb8e711b6cfdc3d398254692ed9cbb6f8c9)
2021-11-03i18n: Sync editor translations with WeblateRémi Verschelde
Latvian (lv) is now above the threshold for inclusion. (cherry picked from commit 74bcf37f90faa8b5ec2bfe2bf2b36934ac875f4b)
2021-10-20i18n: Only include editor translations above a thresholdRémi Verschelde
This reduces the size of the editor binaries significantly, as we otherwise embed all WIP translations, including ones with very low completion ratios, and end up paying for the size of all `msgid`s for each locale. Cf. https://github.com/godotengine/godot-proposals/issues/3421 for details. The thresholds used are: - 30% for the editor interface (should already include most common strings while more obscure ones like UndoRedo action names might be untranslated). - 10% for the class reference: this is a HUGE resource and 10% is already a lot of useful content, especially if focused on the most used APIs. This currently reduces the size of the editor binary by 17% on Linux. The list will be synced manually every now and then. (cherry picked from commit 8425c589911f8ffc006990f4149859e175ae93a9)
2021-10-15SCons: List `.gen.cpp` sources explicitly to avoid globbing errorsRémi Verschelde
Whenever we change the name (or remove) generated cpp files with the `.gen.cpp` extension, users run into build issues when switching between branches (i.e. switching before and after the name change/removal). This is because we glob `*.cpp` so if a now-obsolete file from a previous build is present, we'll include it too, potentially leading to bugs or compilation failure (due to missing headers or invalid code). So globbing patterns in `add_source_files` will now skip files ending with `.gen.cpp`, which should instead be passed explicitly where they're used.
2021-08-12Allow additional cpp files to be added for export templateSergey Minakov
2020-07-28SCons: Refactor running commands through buildersAndrii Doroshenko (Xrayez)
A new `env.Run` method is added which allows to control the verbosity of builders output automatically depending on whether the "verbose" option is set. It also allows to optionally run any SCons commands in a subprocess using the existing `run_in_subprocess` method, unifying the interface. `Action` objects wrap all builder functions to include a short build message associated with any action. Notably, this removes quite verbose output generated by `make_doc_header` and `make_editor_icons_action` builders.
2020-05-25Add `custom_modules` build option to compile external user modulesAndrii Doroshenko (Xrayez)
This patch adds ability to include external, user-defined C++ modules to be compiled as part of Godot via `custom_modules` build option which can be passed to `scons`. ``` scons platform=x11 tools=yes custom_modules="../project/modules" ``` Features: - detects all available modules under `custom_modules` directory the same way as it does for built-in modules (not recursive); - works with both relative and absolute paths on the filesystem; - multiple search paths can be specified as a comma-separated list. Module custom documentation and editor icons collection and generation process is adapted to work with absolute paths needed by such modules. Also fixed doctool bug mixing absolute and relative paths respectively. Implementation details: - `env.module_list` is a dictionary now, which holds both module name as key and either a relative or absolute path to a module as a value. - `methods.detect_modules` is run twice: once for built-in modules, and second for external modules, all combined later. - `methods.detect_modules` was not doing what it says on the tin. It is split into `detect_modules` which collects a list of available modules and `write_modules` which generates `register_types` sources for each. - whether a module is built-in or external is distinguished by relative or absolute paths respectively. `custom_modules` scons converter ensures that the path is absolute even if relative path is supplied, including expanding user paths and symbolic links. - treats the parent directory as if it was Godot's base directory, so that there's no need to change include paths in cases where custom modules are included as dependencies in other modules.
2020-04-02Replace NULL with nullptrlupoDharkael
2020-03-30SCons: Format buildsystem files with psf/blackRémi Verschelde
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-25SCons: Drop support for Python 2Rémi Verschelde
We now require SCons 3.0+ (first version with Python 3 support), and we set min required Python 3 version to 3.5 (3.4 and earlier are EOL).
2020-03-24Move DocData and Collada out of their subfoldersRémi Verschelde
Now that the unused DocDump was removed, the `editor/doc` subfolder is redundant. Similarly, there's no reason for Collada to have a subfolder for itself when glTF or OBJ don't.
2020-03-20i18n: Add support for translating the class referenceRémi Verschelde
- Parse `.po` files from `doc/translations/*.po` like already done with `editor/translations/*.po`. - Add logic to register a doc translation mapping in `TranslationServer` and `EditorSettings`. - Add `DTR()` to lookup the doc translation mapping (similar to `TTR()`). Strings are automatically dedented and stripped of whitespace to ensure that they would match the translation catalog. - Use `DTR()` to translate relevant strings in `EditorHelp`, `EditorInspector`, `CreateDialog`, `ConnectionsDialog`. - Small simplification to `TranslationLoaderPO`, the path argument was not really meaningful.
2020-02-21Huge Debugger/EditorDebugger refactor.Fabio Alessandrelli
2019-07-22SCons: Fix uses of [].append instead of env.add_source_files()Rémi Verschelde
Also added support for SCons project-absolute paths (starting with #) and warning about duplicates in add_source_files(), and fixed default_controller_mappings.gen.cpp being included twice after first build due to *.cpp globbing. Part of #30270.
2019-05-22Build Clipper with `tools=no` and patch it to auto-disable exceptionsAndrii Doroshenko (Xrayez)
Reverts "Build polygon clipper only in tools builds" (see #17319) which allows to build Clipper with tools disabled (release) and because of that, Clipper has to be patched to optionally disable exceptions in order to be built on some platforms. Patched Clipper 6.4.2 to be compiled with exceptions enabled/disabled. and ensure that Clipper-specific exception macros are defined: don't use exceptions by default unless exception handling is detected. Compilation with exceptions will be determined by various C++ exceptions defines: * ` __cpp_exceptions` is part of C++ feature testing macros (since C++98); * `__EXCEPTIONS` is used by some GNU compilers; * `_CPPUNWIND` is used by MSVC. The user can override specific exceptions behavior via corresponding `*_USER` macros (i.e. compiling for embedded systems).
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-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-15Bundle SSL certs with the templates.Fabio Alessandrelli
If this is undesired it can be avoided by specifying builtin_certs=no . Bundled SSL certs will be used unless you specify an override in: Project Settings -> SSL -> Certificates .
2018-09-01Removed some unneeded generated headers from the editor directory SCsub.Ibrahn Sahir
These headers are currently built in (and included from) the core directory. Removing the editor directory versions to avoid confusion.
2018-08-29BuildSystem: Sort input file listsBernhard M. Wiedemann
so that godot package builds reproducibly in spite of indeterministic filesystem readdir order and http://bugs.python.org/issue30461 See https://reproducible-builds.org/ for why this is good. Sort font input file list, so that builtin_fonts.gen.h is created in a reproducible way Sort list of platforms, so that editor/register_exporters.gen.cpp is created in a reproducible way Sort list of source files, so that .a files and resulting godot binaries are created in a reproducible way
2018-08-29BuildSystem: Fix font listBernhard M. Wiedemann
We want to add the individual strings to the list and not add a list object to the list. Without this patch, sorting failed because "str < list" is not a valid operation in python.
2018-07-27Running builder (content generator) functions in subprocesses on WindowsViktor Ferenczi
- Refactored all builder (make_*) functions into separate Python modules along to the build tree - Introduced utility function to wrap all invocations on Windows, but does not change it elsewhere - Introduced stub to use the builders module as a stand alone script and invoke a selected function There is a problem with file handles related to writing generated content (*.gen.h and *.gen.cpp) on Windows, which randomly causes a SHARING VIOLATION error to the compiler resulting in flaky builds. Running all such content generators in a new subprocess instead of directly inside the build script works around the issue. Yes, I tried the multiprocessing module. It did not work due to conflict with SCons on cPickle. Suggested workaround did not fully work either. Using the run_in_subprocess wrapper on osx and x11 platforms as well for consistency. In case of running a cross-compilation on Windows they would still be used, but likely it will not happen in practice. What counts is that the build itself is running on which platform, not the target platform. Some generated files are written directly in an SConstruct or SCsub file, before the parallel build starts. They don't need to be written in a subprocess, apparently, so I left them as is.
2018-06-21add NoCache wrapper to CommandRhody Lugo
2018-05-19GDScript access to copyright, license, author and donor information.Ibrahn Sahir
Adds following functions to the Engine singleton: get_author_info - names of Godot authors get_copyright_info - detailed source copyright get_license_info get_donor_info - donor names get_license_info - full text of licenses used, indexed by license names get_license_text - the text of the Godot Expat license
2018-03-13Merge pull request #17440 from viktor-ferenczi/issue-5042Rémi Verschelde
Properly closing all files in Python build code
2018-03-11Properly closing all files in Python codeViktor Ferenczi
2018-03-06Build polygon clipper only in tools buildsLeon Krause
2017-11-28disable caching for targets using helper functionsRhody Lugo
2017-11-28use the same cache for all branches for appveyorRhody Lugo
2017-11-17Added modules' doc files to make_doc_headerZher Huei Lee
They were somehow never included. This fixes that.
2017-11-15Improve code style of generated headersRémi Verschelde
2017-11-07Ignore files not ending with '.xml' when building doc headermhilbrunner
2017-10-21Cleanup unnecessary debug printsRémi Verschelde
2017-10-07fixed double escape for quotes in editor/SCsubMarius Guggenmos
2017-10-04Fix Python 3 buildMatthias Hoelzl
- Take care of the differences in handling unicode characters in `escape_string` (formerly in `editor/SCsub`, now in `compat.py)`. - Conditionally include `_winreg` or `winreg` in the Mono editor module.
2017-10-02Merge pull request #11592 from SaracenOne/header_generator_fixAndreas Haas
Python header generator now generates strings with escape characters.
2017-09-26Python header generator now generates strings with escape characters.Saracen
2017-09-25Use BoolVariable in target/component/advanced options.Elliott Sales de Andrade
2017-09-16Fix errors in Python 3 buildMatthias Hoelzl
2017-09-12Changed the doc class generation to individual files per class. It is also ↵Juan Linietsky
possible to save module files in module directories and the build system will recognize them.
2017-09-04EditorAbout: add donors tabPoommetee Ketson
2017-08-27Make build scripts Python3 compatibleMatthias Hoelzl
- The Windows, UWP, Android (on Windows) and Linux builds are tested with Scons 3.0 alpha using Python 3. - OSX and iOS should hopefully work but are not tested since I don't have a Mac. - Builds using SCons 2.5 and Python 2 should not be impacted.
2017-08-27Fix mixed tab/whitespace in build filesMatthias Hoelzl