summaryrefslogtreecommitdiff
path: root/methods.py
AgeCommit message (Collapse)Author
2023-04-24Fix forced optimization in dev_buildsmix8
Fixes forced optimization in dev_build. (cherry picked from commit b18c7481aac9f79e7108e12458bc6743945311bd)
2023-04-07Fix the Python type error when creating the .sln fileHK-SHAO
(cherry picked from commit 19a8efc8759794bc39121809016245988f2db216)
2023-02-16Let VS solution name be overriddenPedro J. Estébanez
2023-01-13Merge pull request #63312 from bruvzg/one_clickRémi Verschelde
[Export] Add one-click deploy over SSH for the desktop exports.
2023-01-09Support Git worktrees in generation of hash headerPedro J. Estébanez
2022-12-29[Export] Add one-click deploy over SSH for the desktop exports.bruvzg
Add one-click deploy over SSH for the desktop exports. Add ZIP export option for Linux and Windows. Change export plugin icons to SVG format.
2022-12-10Rename `float=64` SCons option to `precision=double`Hugo Locurcio
This avoids confusion with the old `bits=64` option and building for 64-bit CPUs in general.
2022-10-05.NET: Generate SdkPackageVersions.props from version.pyRémi Verschelde
Ensures that the versions always match the Godot version, albeit following SemVer 2.0 so inserting a dot between "beta" and the build number. For "stable" status, we omit the suffix as this would be interpreted as a pre-release build too. So we have: | Godot version | Nupkg version | | -------------- | -------------- | | 4.0.0-beta | 4.0.0-beta | | 4.0.0-beta2 | 4.0.0-beta.2 | | 4.0.0-rc1 | 4.0.0-rc.1 | | 4.0.0-stable | 4.0.0 |
2022-10-04Various enhancements to Visual Studio solution generation.TechnoPorg
This adds support for building solutions with dev_mode and/or float=64 enabled. Additionally, it adds solution generation to the Windows CI to catch future regressions.
2022-10-04Merge pull request #66718 from afestini/fix_vs_project_creationRémi Verschelde
Fix VS project creation
2022-10-03vsproj: create build targets depending on dev_buildAlexander Festini
2022-10-02fix methods.py ->NameError: name 'sys' is not definedjwt
Update methods.py Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2022-09-30ci: add Python static analysis check via mypyJiri Suchan
2022-09-30Merge pull request #66242 from akien-mga/scons-unify-tools-targetRémi Verschelde
2022-09-27SCons: Fix MSVC D9025 warning overriding opt levelRémi Verschelde
And cleanup disable_warnings too to avoid setting `/w` / `-w` multiple times.
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-09-25Fix compilation with custom "GODOT_VERSION_STATUS"Björn Feber
2022-09-24Don't add `editor_sources` to vs_project when `tools=no`nikitalita
`editor_sources` was being added to the vs_project when godot is compiled with `tools=no`, which caused the build to fail.
2022-09-14SCons: Add `methods.get_version_info()` method returning a DictRémi Verschelde
This makes it possible to retrieve all relevant versioning info used to generate `core/version_generated.gen.h` in the buildsystem. Notably it makes the custom logic parsing the `GODOT_VERSION_STATUS` environment variable to override status easy to reuse.
2022-09-07C#: Replace libnethost dependency to find hostfxrIgnacio Roldán Etcheverry
We want to replace libnethost as it gives us issues with some compilers. Our implementation tries to mimic libnethost's hostfxr_resolver search logic. We try to use the same function names for easier comparing in case we need to update this in the future.
2022-08-31Fix build failures for Android on WindowsFredia Huya-Kouadio
The issue is caused by https://github.com/godotengine/godot/pull/64306 which makes use of a 3.7 feature while the current recommended python version is 3.5 for 3.x and 3.6 for master.
2022-08-27Correct output file names for Visual Studio project generationSaracenOne
2022-08-25Unify bits, arch, and android_arch into env["arch"]Aaron Franke
Fully removes the `bits` option and adapts the code that relied on it. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-08-22C#: Begin move to .NET CoreIgnacio Roldán Etcheverry
We're targeting .NET 5 for now to make development easier while .NET 6 is not yet released. TEMPORARY REGRESSIONS --------------------- Assembly unloading is not implemented yet. As such, many Godot resources are leaked at exit. This will be re-implemented later together with assembly hot-reloading.
2022-08-12Fix jumbled error output when using Windows spawn fixPedro J. Estébanez
2022-08-04[Scons] Implement module dependency sorting.Fabio Alessandrelli
Modules can now call: env.module_add_dependencies(name: str, deps: list, optional: bool) To add required or optional dependencies during the "can_build" step. Required dependencies will be checked and the module will be not be enabled when they are missing, printing a warning to notify the user.
2022-07-31SCons: Fix creating VS solution with SCons 4.4.0Rémi Verschelde
Fixes #63709. Co-authored-by: 19PHOBOSS98 <37253663+19PHOBOSS98@users.noreply.github.com>
2022-07-24support git packed refs in version generatorNathan Franke
2022-07-21Rename OSX to macOS and iPhoneOS to iOS.bruvzg
2022-05-04Refactor module initializationreduz
* Changed to use the same stages as extensions. * Makes the initialization more coherent, helping solve problems due to lack of stages. * Makes it easier to port between module and extension. * removed the DRIVER initialization level (no longer needed).
2022-02-09Core: Move generated `VERSION_HASH` to a `.cpp` fileRémi Verschelde
This lets us have its definition in `core/version.h` and avoid rebuilding a handful of files every time the commit hash changes.
2022-01-17Merge pull request #55968 from Calinou/scons-tweak-build-messagesRémi Verschelde
2022-01-15VS Projects: Don't include `mono_reg` without its moduleMario Liebisch
2021-12-15Tweak SCons compilation messages to be more discreetHugo Locurcio
All compilation messages are now written in blue to ensure that compiler errors and warnings stand out more. Messages were also slightly shortened to make them easier to fit on a single line on narrow terminals.
2021-11-15Allow dehardcoding documentation branch and URL in docs linksRémi Verschelde
This makes it possible to change the branch of the documentation that URLs are pointing to without having to modify all class reference files. In the XML class reference, the `$DOCS_URL` placeholder should be used, and will be replaced automatically in the editor and when generating the RST class reference. The documentation branch string is set in `version.py`. Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2021-10-25Fix import for collections Mapping Hristo Stamenov
Mapping and other "abstract base classes" were moved after python 3.3 from collections to collections.abc Python 3.3 is long gone and a newer version of python won't support this code.
2021-10-18Merge pull request #53376 from ganondev/vsproj-props-for-monoRémi Verschelde
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-10-06Variants and targets are generated instead of manually defined. The specific ↵Edward Auttonberry
details for each configuration are logically separated from the generators Add support for specifying defines for each configuration Add support for specifying extra cli args for each configuration Add support for specifying extra includes for each configuration
2021-09-28Force optimized builds for thirdparty Embree filesjfons
2021-08-27Makes FontData importable resource.bruvzg
Adds multi-channel SDF font texture generation and rendering support. Adds per-font oversampling support. Adds FontData import plugins (for dynamic fonts, BMFonts and monospaced image fonts), font texture cache pre-generation and loading. Adds BMFont binary format and outline support.
2021-08-18SCons: Fix potential error when pruning cache on CIRémi Verschelde
This could cause spurious errors on CI when trying to prune the cache, as for some reason it tries to remove files/paths which do not exist. That points at a bug in the `cache_progress` logic but at least this workaround should prevent CI failures.
2021-08-06SCons: Add method to detect Emscripten and use it for warnings configRémi Verschelde
Emscripten is LLVM-based so we want to follow the same logic. But we can't just put it as a match in `methods.using_clang()` as that would mess with the compiler version detection logic used to restrict old GCC and Clang releases.
2021-08-05SCons: Fix info message when defining `GODOT_VERSION_STATUS`Rémi Verschelde
2021-07-29Allow overriding `VERSION_STATUS` with `GODOT_VERSION_STATUS` in envRémi Verschelde
`VERSION_STATUS` is part of what constitutes the reference version for a given Godot build, and is part of the version check for compatible export templates. For dev snapshots (alpha, beta, RCs), we usually set the `VERSION_STATUS` to a specific build number (e.g. `beta2`), but this change doesn't end up committed to the Git repository as we don't want to keep changing `version.py` for testing builds. So this new environment override will be what can be used in official builds and by users making custom builds for specific snapshots.
2021-07-13Implement the ability to disable classesreduz
* This PR adds the ability to disable classes when building. * For now it's only possible to do this via command like: `scons disable_classes=RayCast2D,Area3D` * Eventually, a proper UI will be implemented to create a build config file to do this at large scale, as well as detect what is used in the project.
2021-05-31Improve compiler version extractionMmAaXx500
2021-03-23SCons: Pass tests configuration to the MSVC solutionResul Çelik
Test sources and build parameter were not supplied to the visual studio project. This resulted in a build that was not able to be test using the --test command. Adding build parameter ensures we can test, and supplying the sources ensures we have all files to write new tests and edit existing ones.
2021-03-12Fixes small typos and grammar correctionAnshul7sp1
2021-02-24SCons: Properly handle overriding default values to bool optionsRémi Verschelde
The `dev=yes` and `production=yes` options work as aliases to set a number of options, while still aiming to allow overriding specific options if the user wishes so. (E.g. `production=yes use_lto=no` should work to enable production defaults *but* disable LTO.) That wasn't working as `ARGUMENTS.get()` returns a string and not a boolean as expected by `BoolVariable`, and this wasn't flagged as a bug... So added a helper method using SCons' `BoolVariable._text2bool` to do the conversion manually.