summaryrefslogtreecommitdiffstats
path: root/platform/javascript/detect.py
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Enable Theora module for HTML5 platformLeon Krause2018-08-281-1/+0
|
* Build HTML5 release_debug with -Os, like release.Leon Krause2018-05-141-10/+6
| | | | | The increased build time is negligible in comparison to the decreased file size.
* Small refactoring in HTML5 build scriptsLeon Krause2018-05-141-3/+0
| | | | Drop logic for non-existent 'profile' target
* Merge pull request #17792 from eska014/enginejs-preloadpathsRémi Verschelde2018-04-041-7/+0
|\ | | | | Handle directories in engine.js preloadFile()
| * Expose Emscripten libs to engine.js discreetlyLeon Krause2018-03-271-7/+0
| |
* | Detect and configure JavaScript build per Emscripten configuration fileLeon Krause2018-03-291-5/+15
|/
* Refactor JavaScript platform build scriptLeon Krause2018-03-261-47/+66
|
* Add RWLockDummy for NO_THREADS buildsLeon Krause2018-03-201-1/+1
|
* Disable Emscripten assertions in release_debug buildsLeon Krause2018-03-181-1/+2
| | | | The messages generated by some assertions can be confusing to users.
* Disabled mbedtls module in javascript platformFabio Alessandrelli2018-02-141-2/+2
|
* Deleting OpenSSL module and libraryFabio Alessandrelli2018-02-141-1/+1
|
* Disable OpenSSL module in HTML5 platform by defaultLeon Krause2018-01-251-0/+5
|
* Build WebAssembly module with -Os to decrease file sizeLeon Krause2018-01-071-2/+8
|
* Change HTML5 start-up APILeon Krause2017-11-191-6/+5
| | | | | | | | Rename engine.start() to startGame(), new start() takes string arguments handed directly to main(). Rename Engine.loadEngine() to load(). Add setLocale(), setResizeCanvasOnStart(), setExecutableName() and preloadFile().
* Remove asm.js support from HTML5 platformLeon Krause2017-11-181-12/+5
| | | | | Since WebGL 2.0 is required, requiring WebAssembly support as well has little impact on compatibility.
* Detect javascript platform using EMSCRIPTEN env as wellMarcelo Fernandez2017-10-281-2/+5
|
* Use BoolVariable in platform-specific options.Elliott Sales de Andrade2017-09-251-5/+5
|
* Use BoolVariable for module options.Elliott Sales de Andrade2017-09-251-2/+2
|
* Use BoolVariable in target/component/advanced options.Elliott Sales de Andrade2017-09-251-1/+1
|
* Merge pull request #11154 from eska014/html5-startup-revampPoommetee Ketson2017-09-121-0/+2
|\ | | | | HTML5 start-up overhaul with download progress display
| * HTML5 start-up overhaulLeon Krause2017-09-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Implement promise-based JS interface for custom HTML page integration - Add download progress callback - Add progress bar and indeterminate spinner to default HTML page - Try downloading files multiple times when failing - Get rid of godotfs.js - Separate steps for engine initialization, game initialization and game start - Allow multiple games on one HTML page - Substitution placeholders only used in .html file - Placeholders renamed: $GODOT_BASE => $GODOT_BASENAME, $GODOT_TMEM -> $GODOT_TOTAL_MEMORY - Emscripten Module is now Engine.RuntimeEnvironment (no longer a global)
* | Make build scripts Python3 compatibleMatthias Hoelzl2017-08-271-1/+1
|/ | | | | | | | - 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.
* Buildsystem: Improve detect.py readability and fix issuesRémi Verschelde2017-07-011-26/+36
| | | | | | | | | | | | | | | | | | | Tried to organize the configure(env) calls in sections, using the same order for all platforms whenever possible. Apart from cosmetic changes, the following issues were fixed: - Android: cleanup linkage, remove GLESv1_CM and GLESv2 - iPhone: Remove obsolete "ios_gles22_override" option - OSX: * Fix bits detection (default to 64) and remove obsolete "force_64_bits" option (closes #9449) * Make "fat" bits argument explicit - Server: sync with X11 - Windows: clean up old DirectX 9 stuff - X11: * Do not require system OpenSSL for building (closes #9443) * Fix typo'ed use_leak_sanitizer option * Fix .llvm suffix overriding custom extra_suffix
* Merge pull request #8191 from eska014/webgl2-exportJuan Linietsky2017-03-291-1/+1
|\ | | | | WebGL 2 export per WebAssembly or asm.js
| * WebGL 2 export per WebAssembly or asm.jseska2017-03-291-1/+1
| |
* | SCons: Add option to toggle warnings (on by default)Rémi Verschelde2017-03-261-1/+1
|/ | | | | | | | All the warnings are factored out of the platform-specific files and moved to SConstruct. Will have to check that it does not introduce regressions on some platforms/compilers. (cherry picked from commit 31107daa1a41fe9ab3c7c1868479e78e16848333)
* Some WebGL 2 and build fixes/clean-upeska2017-03-171-16/+13
|
* more html5 fixesJuan Linietsky2017-03-141-2/+3
|