summaryrefslogtreecommitdiff
path: root/modules/mono/config.py
AgeCommit message (Collapse)Author
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-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-29[Web] Rename JavaScript platform to Web.Fabio Alessandrelli
Also rename export name from "HTML5" to "Web".
2022-08-24Remove mentions of the Server platform from the Mono moduleAaron Franke
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-22C#: Move marshaling logic and generated glue to C#Ignacio Roldán Etcheverry
We will be progressively moving most code to C#. The plan is to only use Mono's embedding APIs to set things at launch. This will make it much easier to later support CoreCLR too which doesn't have rich embedding APIs. Additionally the code in C# is more maintainable and makes it easier to implement new features, e.g.: runtime codegen which we could use to avoid using reflection for marshaling everytime a field, property or method is accessed. SOME NOTES ON INTEROP We make the same assumptions as GDNative about the size of the Godot structures we use. We take it a bit further by also assuming the layout of fields in some cases, which is riskier but let's us squeeze out some performance by avoiding unnecessary managed to native calls. Code that deals with native structs is less safe than before as there's no RAII and copy constructors in C#. It's like using the GDNative C API directly. One has to take special care to free values they own. Perhaps we could use roslyn analyzers to check this, but I don't know any that uses attributes to determine what's owned or borrowed. As to why we maily use pointers for native structs instead of ref/out: - AFAIK (and confirmed with a benchmark) ref/out are pinned during P/Invoke calls and that has a cost. - Native struct fields can't be ref/out in the first place. - A `using` local can't be passed as ref/out, only `in`. Calling a method or property on an `in` value makes a silent copy, so we want to avoid `in`. REGARDING THE BUILD SYSTEM There's no longer a `mono_glue=yes/no` SCons options. We no longer need to build with `mono_glue=no`, generate the glue and then build again with `mono_glue=yes`. We build only once and generate the glue (which is in C# now). However, SCons no longer builds the C# projects for us. Instead one must run `build_assemblies.py`, e.g.: ```sh %godot_src_root%/modules/mono/build_scripts/build_assemblies.py \ --godot-output-dir=%godot_src_root%/bin \ --godot-target=release_debug` ``` We could turn this into a custom build target, but I don't know how to do that with SCons (it's possible with Meson). OTHER NOTES Most of the moved code doesn't follow the C# naming convention and still has the word Mono in the names despite no longer dealing with Mono's embedding APIs. This is just temporary while transitioning, to make it easier to understand what was moved where.
2022-08-03Add Text Server related options to the build profiles editor.bruvzg
Adds SCons options to disable Brotli and Graphite. Adds option categories to the build profiles editor. Adds options default state to the build profiles editor. Adds Text Server related options to the build profiles editor. Fix misplaced OpenGL/Vulkan SCons options.
2022-07-21Rename OSX to macOS and iPhoneOS to iOS.bruvzg
2021-10-22Add support for the RISC-V architectureAaron Franke
Supports RV64GC (RISC-V 64-bit with general-purpose and compressed-instruction extensions)
2020-12-06Mono: Add mono_bcl SCons option for a custom BCL locationIgnacio Etcheverry
Makes it let's bothersome to work with builds from our godotengine/godot-mono-builds scripts, as they write the BCL into an output directory separate from the runtime (which is good as two runtimes may share the same BCL).
2020-11-25Core: Always enable ptrcall, remove PTRCALL_ENABLED defineRémi Verschelde
ptrcall is now also used to optimize calls in GDScript, on top of the existing use by the GDNative and Mono modules. It no longer makes sense to make it optional.
2020-09-25Style: Fix black formatting after #42332Rémi Verschelde
Somehow it did not run CI checks so we missed that one. Also pin `black` version to latest upstream release.
2020-09-25Enable the `copy_mono_root` SCons option by defaultHugo Locurcio
This closes #41652.
2020-06-17DocData: Skip language-specific ClassDoc without methods/constantsRémi Verschelde
Removes the useless `@C#`, `@NativeScript` and `@VisualScript` entries.
2020-05-22Add SCons option to not build C# solutionsIgnacio Etcheverry
2020-05-09Mono: Use msbuild instead of nuget.exe for restoringIgnacio Etcheverry
- Make GodotTools output directly to the SCons output directory. - Removed xbuild_fallback from the build system.
2020-03-31Mono/C#: Add iOS supportIgnacio Etcheverry
Right now, games only work on devices when exported with FullAOT+Interpreter. There are some issues left that need to addressed for FullAOT alone. Right now, it's giving issues with the Godot.NativeCalls static constructor.
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-26Multiple changes to DisplayServerX11Mateo Kuruk Miccino
- Travis: Change x11 to linuxbsd - SCons: Change x11 plataform to linuxbsd - Plugins: Remove ; to avoid fallthrough warning - DisplayServerX11: Implement set_icon - DisplayServerX11: Fix X11 bug when a window was erased from windows map, all the changes from that erased windows are sending to the main window - DisplayServerX11: Reorder create_window commands - DisplayServerX11: Change every Size2 to Size2i and Rect2 to Rect2i where it belongs + More X11 fixes which have been integrated directly back into reduz's original commits while rebasing the branch.
2020-03-17Generate command line help text for `mono` moduleAndrii Doroshenko (Xrayez)
2019-11-13Mono/C#: WebAssembly supportIgnacio Etcheverry
2019-06-04Mono: Fix SCons options added to the wrong environmentIgnacio Etcheverry
2019-04-07Mono: Reorganize build scriptsIgnacio Etcheverry
All build scripts, other than config.py and SCSub, are now located in the build_scripts subdirectory.
2019-04-06Remove unused importsHendrikto
2018-12-22SCons: Allow building Mono module with OSXCrossRémi Verschelde
Improve the test logic to only assume that we're building for macOS if OSXCROSS_ROOT is defined *and* we requested p=osx. Supersedes #24480.
2018-11-08Fix assertion fail when loading assembly on project exportIgnacio Etcheverry
2018-10-03Mono: Editor and export template dependencies and fixesIgnacio Etcheverry
- Bundle editor dependencies: - 'GodotSharp': Root data directory for the editor - 'Tools': Editor dependencies. Only GodotSharp.dll for now. - 'Api': Prebuilt GodotSharp and GodotSharpEditor API assemblies. - 'Mono': Mono files to bundle with the editor. - 'bin': (Optional, not used for now) Mono bin directory. - 'etc': Mono configuration files. - 'lib': Mono dependency shared libraries. - 'lib/mono/4.5': Framework assemblies. - Added build option to copy the required files from the mono installation to 'GodotSharp/Mono'. Enable with 'copy_mono_root=yes'. Disabled by default. - Export template dependencies: - 'data_AppName'/'data_Godot': - 'Mono': Mono files to bundle with the game. - 'etc': Mono configuration files. - 'lib': Mono dependency shared libraries. - The data directory is generated when compiling and must be bundled with the export templates. In the case of OSX, the data directory must be placed inside the 'osx.zip' export template. - In OSX, alternative location for directories (needed for app bundles) are: - 'data_AppName/Mono/etc' --> '../Resources/GodotSharp/Mono/etc' - 'data_AppName/Mono/lib' --> '../Frameworks/GodotSharp/Mono/lib' - The editor can bundle prebuilt API assemblies. - Generate them with a tools build by running: `--generate-cs-core-api <GodotSharp_OutputDir> --generate-cs-editor-api <GodotSharpEditor_OutputDir> <GodotSharp_OutputDir>/bin/Release/GodotSharp.dll` (This command will be simplified in the future and both projects will be in the same solution) - Build the solutions and copy the output files to '#bin/GodotSharp/Api'. - Fixed API assembly being added twice during the export process.
2018-09-17Merge pull request #22193 from ↵Ignacio Etcheverry
neikeq/idontlikesanditscoarseandroughandirritatinganditgetseverywhere Mono: Build and external editor improvements for OSX
2018-09-17Add some mono root dir hints to the build scriptIgnacio Etcheverry
This enhancement is specially noticeable in OSX, since it includes Mono's install location (both official and homebrew). This makes it possible to build Godot with Mono on OSX without pkg-config (pkg-config is bundled with Mono, but it's not added to PATH, so finding it would require finding the Mono root directory first).
2018-09-16Check for mono binary when finding versionSophie Tauchert
2018-08-20Prevent "cannot use a string pattern on a bytes-like object"Justin Abene
Fixes #21207
2018-08-14SCons: Fix mono_root initializationRémi Verschelde
As advised by @neikeq.
2018-08-13Fixed absent variable exception while trying to raise another exception.Teashrock
2018-07-04Mono: Fix build script not decoding process utf-8 outputIgnacio Etcheverry
2018-07-04Mono: Pending exceptions and cleanupIgnacio Etcheverry
2018-06-22Merge pull request #19016 from neikeq/wIgnacio Etcheverry
Mono: Module build improvements
2018-06-22Mono: Module build improvementsIgnacio Etcheverry
- Add (Csc/Vbc/Fsc)ToolExe environment variables when running Mono's MSBuild. - Fix directory for the 'mono_assemblies_output_dir' argument being created with the '#' top level directory token as part of its name. - Allow to build with 'mono_static=yes' on Unix without specifying a mono prefix. The build script will try to find the mono prefix using the output from pkg-config.
2018-06-01Fix Mono static linking on MingwHein-Pieter van Braam
2018-05-30SCons: Pass env to modules can_build methodRémi Verschelde
This allows to disable modules based on the environment, in particular `env[tools]` which tells us if we are building the editor or not.
2018-05-02Fix MSVC check when building with monoIgnacio Etcheverry
2018-04-25Add option to link mono statically on WindowsIgnacio Etcheverry
2018-03-19Fix mono build properly!PJB3005
Fixes the mistake I made in #17603 to make it require Python > 3.6.
2018-03-18Fix Mono builds with Python 3.Pieter-Jan Briers
A subprocess call wasn't specifying an encoding, so this gave a TypeError in Python 3.
2018-02-27More reliably find mscorlib.dll on LinuxHein-Pieter van Braam
2018-02-27Merge pull request #15641 from ↵Rémi Verschelde
neikeq/mono-is-picky-regarding-corlib-so-we-must-make-sure-to-ship-the-right-version-otherwise-something-bad-may-happen Mono: Buildsystem improvements
2018-02-03Fix pkgconfig detection of monoBenjamin Dobell
2018-01-12Mono: Buildsystem improvementsIgnacio Etcheverry
- Bundle with mscorlib.dll to avoid compatibilities issues - Add build option 'mono_assemblies_output_dir' to specify the output directory where the assemblies will be copied to. '#bin' by default.
2017-11-15doc: Make all module docs self-containedRémi Verschelde
2017-11-01-Modules can now add custom version info (added it for Mono)Juan Linietsky
-Version string takes this version info -Ability to download templates from the interweb (listing does not work yet)
2017-10-29Buildsystem improvements for the Mono moduleIgnacio Etcheverry
- Make sure to search the mono installation directory for the right architecture in the windows registry. - Do not build GodotSharpTools directly to #bin dir. Instead build to the default output path and copy it. This way we avoid MSBuild adding files we don't want to #bin. - Add hint path for MSBuild in OSX. - Copy shared library on Unix if not statically linking. - Use vswhere to search MSBuild and search for 14.0 tools version in the registry instead of 4.0. - SCons will only fallback xbuild when msbuild is not found if 'xbuild_fallback=yes' is passed to the command. - Use mono's assembly path as FrameworkPathOverride if using with system's MSBuild (not mono's fork). - Cleanup.