summaryrefslogtreecommitdiffstats
path: root/platform/javascript/detect.py
Commit message (Collapse)AuthorAgeFilesLines
* SCons: Set `DEBUG_ENABLED` and `DEV_ENABLED` in SConstructRémi Verschelde2021-10-151-3/+0
| | | | | They're the same for all platforms so they don't need to be repeated in all platform definitions.
* SCons: Add `DEV_ENABLED` defines for `target=debug` buildsRémi Verschelde2021-10-141-0/+1
| | | | | | | | | | | This will allow adding developer checks which will be fully compiled out in user builds, unlike `DEBUG_ENABLED` which is included in debug tempates and the editor builds. This define is not used yet, but we'll soon add code that uses it, and change some existing `DEBUG_ENABLED` checks to be performed only in dev builds. Related to godotengine/godot-proposals#3371.
* [HTML5] Make threads build the default.Fabio Alessandrelli2021-07-151-1/+1
| | | | Non-threads build are broken anyway.
* [HTML5] Raise default initial memory to 32 MiB.Fabio Alessandrelli2021-07-131-2/+1
| | | | | | | | | The memory was resized in any case during start. Mitigate Chromium issue: https://bugs.chromium.org/p/v8/issues/detail?id=11863 Also fix a warning about SAFE_HEAP being a linker only flag.
* LinuxBSD now compiles without vulkan/x11.Fabio Alessandrelli2021-06-011-0/+1
|
* [HTML5] Fix builds with recent emscripten versionsFabio Alessandrelli2021-04-301-4/+4
| | | | | Library suffix should be `.a`, the `EXTRA_` in `EXTRA_EXPORTED_RUNTIME_METHODS` is deprecated.
* [JS, Android] Re-add "no-exceptions" for export templates builds with ICU.bruvzg2021-04-201-1/+2
|
* Allow to not optimize release buildRafał Mikrut2021-03-141-9/+9
|
* [HTML5] Add PWA support to the editor page.Fabio Alessandrelli2021-03-081-4/+4
| | | | | | | | | | | | | | | | This allows to install it as an app, and provide offline support (after the first run). Practically, this boils down to adding a JSON file as a manifest, an offline page to be displayed when the cached files are not avaialble, and a JS file to cache resources and return them. The reason for the "first run requirements" is that some browsers, will emit an "install" by just visiting the page (to see if the JS code is compatibile), and we do not want to force casual visitors to just download the 10 MiB+ compressed editor WebAssembly file without pressing the start button. Special thanks to Hugo Locurcio (Calinou) for the initial work.
* [HTML5] Fix compilation issues in 4.0Fabio Alessandrelli2021-02-171-3/+11
| | | | | More memory is needed, and a Workaround to avoid undefined symbol due to dead code elimination.
* Add cwrap to EXTRA_EXPORTED_RUNTIME_METHODSQuadtree2021-02-161-1/+1
|
* Don't handle BaseException in JavaScript build scriptMarcel Admiraal2021-01-281-6/+5
|
* [HTML5] Better editor HTML, small refactor.Fabio Alessandrelli2021-01-251-2/+11
| | | | | Side and GDNative libraries are now added by engine.js , the dynlink pre js had been deleted.
* [HTML5] Fix "initial_memory" build option parsingFabio Alessandrelli2021-01-251-2/+5
|
* [HTML5] Reorganize build script.Fabio Alessandrelli2021-01-101-1/+4
| | | | | Simplify helper functions, fix env/sys_env confusion and depends for externs and pre-js.
* Add support for WebXRDavid Snopek2021-01-041-1/+3
|
* Merge pull request #44315 from madmiraal/fix-handles-baseexceptionRémi Verschelde2020-12-121-3/+1
|\ | | | | Don't handle BaseException in build scripts
| * Don't handle BaseException in build scriptsMarcel Admiraal2020-12-121-3/+1
| |
* | HTML5: Code style cleanup for export codeRémi Verschelde2020-12-101-5/+5
|/
* [HTML5] Improve platform buildsystem.Fabio Alessandrelli2020-12-091-7/+48
| | | | | Check emcc version requirements when building GDNative. Add more build options (sanitizers, initial memory).
* [HTML5] GDNative support via SIDE_MODULE.Fabio Alessandrelli2020-12-051-10/+15
| | | | Working with emscripten >= 2.0.10
* [Complex Text Layouts] Add third-party TextServer dependencies (ICU, ↵bruvzg2020-11-261-0/+2
| | | | HarfBuzz, Graphite).
* SCons: Remove unnecessary $LINK overridesRémi Verschelde2020-11-191-1/+0
| | | | | | | | | | As of SCons 4.0.1, the default value for $LINK is $SMARTLINK, which itself is a function that will use $CXX as linker for C++: https://github.com/SCons/scons/blob/4.0.1/SCons/Tool/link.py#L327-L328 https://github.com/SCons/scons/blob/4.0.1/SCons/Tool/link.py#L54-L76 So we don't need to manually specify the same value as $CXX for $LINK.
* [HTML5] Port JavaScript inline code to libraries.Fabio Alessandrelli2020-11-101-2/+5
| | | | | | | | | The API is implemented in javascript, and generates C functions that can be called from godot. This allows much cleaner code replacing all `EM_ASM` calls in our C++ code with plain C function calls. This also gets rid of few hacks and comes with few optimizations (e.g. custom cursor shapes should be much faster now).
* [HTML5] Update syntax for lto.Fabio Alessandrelli2020-11-101-1/+2
|
* Increase HTML5 THREADPOOL size.Fabio Alessandrelli2020-10-141-1/+1
| | | | | | | This fixes a "random" deadlock when quitting the editor. I still haven't figure out the root cause, but having a bigger seems to greatly mitigate the issue. The new pool size (pre-allocated threads) is now 8.
* [HTML5] Scons now expects "emcc" to be in PATH.Fabio Alessandrelli2020-10-041-5/+3
| | | | | | No longer parse emscripten/emsdk config to detect emcc/node paths. Use WhereIs to find "emcc" and "node", look for "node_modules" in "emcc" path.
* Add extra suffix for HTML5 thread builds.Fabio Alessandrelli2020-10-021-0/+1
|
* Fix Closure compiler build, python style.Fabio Alessandrelli2020-05-101-2/+4
| | | | Move copyToFS into utils.js library included with '--pre-js'.
* DisplayServerJavaScript implementation.Fabio Alessandrelli2020-05-101-8/+8
|
* [HTML5] Locale, input fix, context, exit.Fabio Alessandrelli2020-05-101-0/+3
| | | | | | | Add missing semicolumns in engine.js Add optional extra args to JS Engine.startGame Remove loader.js, explicit noExitRuntime. Also add onExit callback (undocumented in emscripten)
* SCons: Format buildsystem files with psf/blackRémi Verschelde2020-03-301-75/+77
| | | | | | | | | | | | | | | | | | | | | 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.
* [HTML5] Refactor JS, threads support, closures.Fabio Alessandrelli2020-03-111-56/+60
| | | | | | | | | | - Refactored the Engine code, splitted across files. - Use MODULARIZE option to build emscripten code into it's own closure. - Enable lto support (saves ~2MiB in release). - Enable optional closure compiler pass for JS and generated code. - Enable optional pthreads support. - Can now build with tools=yes (not much to see yet). - Dropped some deprecated code for older toolchains.
* Only emit the JavaScript support code for Web when building for HTML5Hugo Locurcio2020-01-311-0/+5
| | | | | Excluding other unused environments like Node.js makes the support code about 4 KB smaller.
* Emscripten: Re-add BINARYEN_TRAP_MODE='clamp' for fastcompRémi Verschelde2019-12-031-0/+7
| | | | | | | | The option is needed when using the 'fastcomp' backend (default before 1.39.0), and must not be defined when using 'upstream' (new default). So we define it conditionally to support both backends. Follow-up to #30751.
* pcre2: Use scons option to disable JIT on some platformsRémi Verschelde2019-11-201-0/+1
| | | | | | | | 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.
* HTML5: Explicitly link idbfs.js for IDBFS supportRémi Verschelde2019-11-191-0/+4
| | | | | | | | | | Upstream Emscripten changed this in 1.39.1+, so IDBFS is no longer included by default and has to be linked manually. The explicit linking doesn't seem to be problematic on earlier versions (tested `1.38.47-upstream`). Fixes #33724.
* HTML5: Fix support for Emscripten 1.39.1+Rémi Verschelde2019-11-151-4/+1
| | | | | | | | | | | | | | | | | | | | | A change in upstream Emscripten 1.39.1+ made our buildsystem error out where it was previously only issuing a warning: ``` [ 5%] Linking Static Library ==> main/libmain.javascript.opt.bc shared:WARNING: Assuming object file output in the absence of `-c`, based on output filename. Please add with `-c` or `-r` to avoid this warning Ranlib Library ==> main/libmain.javascript.opt.bc /opt/emsdk/upstream/bin/llvm-ranlib: error: unable to load 'main/libmain.javascript.opt.bc': file too small to be an archive ``` As advised on emscripten-core/emscripten#9806, we should be using `emar` here to create the static library and not `emcc`. This was apparently done to workaround Emscripten issues in the past, but evidently this is no longer necessary. The rest of the `env` redefinitions should probably be re-assessed against the current state of Emscripten. Fixes #33374.
* https://github.com/godotengine/godot/issues/31297 - HTML5: ↵mellondill2019-08-121-0/+3
| | | | | | this.rtenv.callMain is not a function when using latest-upstream backend Added needed changed for normal compiling with emscripten 1.38.41 and later
* Emscripten: Do not define BINARYEN_TRAP_MODE='clamp'Rémi Verschelde2019-07-221-1/+0
| | | | | | | | It is not supported in Emscripten's `latest-upstream` LLVM backend, and doesn't seem necessary in the `latest` backend either. It was initially added in #22857 to solve a compilation error with the latter. Part of #30270.
* Better detect Emscripten toolchain.Fabio Alessandrelli2019-07-091-2/+7
| | | | | | | | | | | | | | | | | Emscripten is apparently changing the variables in its config file, causing potential breakage of our build system. Binaries of the latest/latest-upstream releases are located in a subfolder of BINARYEN_ROOT called emscripten. Binaries of the other releases (e.g. sdk-1.38.31-64bit) are instead placed under the EMSCRIPTEN_ROOT folder. This PR checks if BINARYEN_ROOT has a subfolder called emscripten, if that does not exists, it falls back to checking the EMSCRIPTEN_ROOT. This way we give precedence to the new releases, given that activating multiple releases sequentially might result in having mismatching BINARYEN_ROOT and EMSCRIPTEN_ROOT.
* Fix Emscripten root directory detection when building for HTML5Hugo Locurcio2019-06-191-3/+3
| | | | | | Recent Emscripten SDK versions seem to only include the `BINARYEN_ROOT` variable in the Emscripten configuration file, whereas the platform's `detect.py` only looked at `EMSCRIPTEN_ROOT`.
* SCons: Keep exceptions and rtti on Android, iOS and HTML5 tools buildRémi Verschelde2019-05-201-4/+6
| | | | | | | | | | Those were disable to keep size small, and on Android avoid the dependency on the STL, but for tools build (editor) this is not really a concern. Note: as of today it's not possible to build tools=yes for those platforms, but this change is one of the necessary steps to enable it. Fixes #25262.
* SCons: Always use env.Prepend for CPPPATHRémi Verschelde2019-04-301-1/+1
| | | | | | 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).
* Remove unused importsHendrikto2019-04-061-1/+0
|
* SCons: Move platform-specific Opus config to its moduleRémi Verschelde2019-03-021-4/+0
|
* Fix file preloading warning in HTML5 platformLeon Krause2019-02-231-4/+0
|
* Fix typos with codespellRémi Verschelde2019-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | Using codespell 1.14.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang doubleclick lod nd numer que te unselect EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
* Implemented audio input support for JavaScript audio driverMarcelo Fernandez2018-11-261-0/+1
|
* Enable --no-heap-copy flag for HTML5 buildsLeon Krause2018-10-291-0/+4
|