Commit graph

81 commits

Author SHA1 Message Date
Rémi Verschelde 89f26c9479 Emscripten: Re-add BINARYEN_TRAP_MODE='clamp' for fastcomp
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.

(cherry picked from commit 6d6280dfa3)
2019-12-03 15:01:43 +01:00
Rémi Verschelde eabf4bbd67 Emscripten: Do not define BINARYEN_TRAP_MODE='clamp'
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.

(cherry picked from commit 63544e6b02)
2019-11-29 16:10:18 +01:00
Rémi Verschelde 8a13eac43d HTML5: Explicitly link idbfs.js for IDBFS support
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.

(cherry picked from commit e5dfcb5edd)
2019-11-29 16:02:17 +01:00
Rémi Verschelde bf204bdc7c HTML5: Fix support for Emscripten 1.39.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.

(cherry picked from commit e9e2a4b044)
2019-11-29 15:58:41 +01:00
Rémi Verschelde f1fc6feca4 SCons: Keep exceptions and rtti on Android, iOS and HTML5 tools build
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.

(cherry picked from commit 4b20959d99)
2019-11-08 15:48:19 +01:00
mellondill 3078f723a8 https://github.com/godotengine/godot/issues/31297 - HTML5: 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

(cherry picked from commit 3c176827d6)
2019-09-24 09:00:44 +02:00
Hendrikto 456eb53439 Remove unused imports
(cherry picked from commit 49a81308c0)
2019-04-20 20:15:44 +02:00
Rémi Verschelde 1807e0f135 SCons: Move platform-specific Opus config to its module 2019-03-02 10:30:25 +01:00
Leon Krause 81554dac61 Fix file preloading warning in HTML5 platform 2019-02-23 20:06:22 +01:00
Rémi Verschelde 5fc86026ca Fix typos with codespell
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
```
2019-02-13 09:23:29 +01:00
Marcelo Fernandez 3a702b3ed8 Implemented audio input support for JavaScript audio driver 2018-11-26 19:14:52 -03:00
Leon Krause 44e5d446c4 Enable --no-heap-copy flag for HTML5 builds 2018-10-29 21:08:51 +01:00
Leon Krause b4b816c122 Enable Theora module for HTML5 platform 2018-08-28 01:56:47 +02:00
Leon Krause 975c0516a4 Build HTML5 release_debug with -Os, like release.
The increased build time is negligible in comparison to the decreased
file size.
2018-05-14 15:31:16 +02:00
Leon Krause 504ffda8d7 Small refactoring in HTML5 build scripts
Drop logic for non-existent 'profile' target
2018-05-14 15:30:27 +02:00
Rémi Verschelde 919209907d
Merge pull request #17792 from eska014/enginejs-preloadpaths
Handle directories in engine.js preloadFile()
2018-04-04 22:26:14 +02:00
Leon Krause 5be7c3dcee Detect and configure JavaScript build per Emscripten configuration file 2018-03-29 04:07:23 +02:00
Leon Krause 63c7fc6358 Expose Emscripten libs to engine.js discreetly 2018-03-27 09:12:08 +02:00
Leon Krause d8d9eea722 Refactor JavaScript platform build script 2018-03-26 19:46:56 +02:00
Leon Krause 25800ffb0e Add RWLockDummy for NO_THREADS builds 2018-03-20 05:37:42 +01:00
Leon Krause d6c9d8d778 Disable Emscripten assertions in release_debug builds
The messages generated by some assertions can be confusing to users.
2018-03-18 21:33:54 +01:00
Fabio Alessandrelli 9e2b1b3b00 Disabled mbedtls module in javascript platform 2018-02-14 01:26:34 +01:00
Fabio Alessandrelli 6fcc8b7e1f Deleting OpenSSL module and library 2018-02-14 01:26:34 +01:00
Leon Krause 4a3aaaf276 Disable OpenSSL module in HTML5 platform by default 2018-01-25 09:07:07 +01:00
Leon Krause 4211e4453e Build WebAssembly module with -Os to decrease file size 2018-01-07 17:43:06 +01:00
Leon Krause 35adf718cf Change HTML5 start-up API
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().
2017-11-19 15:39:57 +01:00
Leon Krause ddf21ca016 Remove asm.js support from HTML5 platform
Since WebGL 2.0 is required, requiring WebAssembly support as well has
little impact on compatibility.
2017-11-18 05:52:14 +01:00
Marcelo Fernandez 33daf4d8bc Detect javascript platform using EMSCRIPTEN env as well 2017-10-28 16:24:44 -03:00
Elliott Sales de Andrade 3e69d19116 Use BoolVariable in platform-specific options. 2017-09-25 14:36:30 -04:00
Elliott Sales de Andrade 5be675eb03 Use BoolVariable for module options. 2017-09-25 14:36:30 -04:00
Elliott Sales de Andrade ffab67b8da Use BoolVariable in target/component/advanced options. 2017-09-25 14:36:02 -04:00
Poommetee Ketson 8bf8cf1316 Merge pull request #11154 from eska014/html5-startup-revamp
HTML5 start-up overhaul with download progress display
2017-09-12 04:35:30 +07:00
Leon Krause 4db801aaea HTML5 start-up overhaul
- 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)
2017-09-11 20:56:29 +02:00
Matthias Hoelzl b6e1e47e3a Make build scripts Python3 compatible
- 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-27 23:05:39 +02:00
Rémi Verschelde e91a267a7c Buildsystem: Improve detect.py readability and fix issues
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
2017-07-01 08:20:51 +02:00
Juan Linietsky 000e873008 Merge pull request #8191 from eska014/webgl2-export
WebGL 2 export per WebAssembly or asm.js
2017-03-29 15:21:52 +02:00
eska 7df7e9cc8b WebGL 2 export per WebAssembly or asm.js 2017-03-29 13:27:43 +02:00
Rémi Verschelde d8f32637be SCons: Add option to toggle warnings (on by default)
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 31107daa1a)
2017-03-26 21:58:37 +02:00
eska 12dd86bba0 Some WebGL 2 and build fixes/clean-up 2017-03-17 15:56:48 +01:00
Juan Linietsky af020160c6 more html5 fixes 2017-03-14 10:53:46 -03:00
eska 1abf478eb9 Fix web export build 2017-03-10 05:09:54 +01:00
Juan Linietsky ffcd954211 Fixes to webgl/opengl es 3.0 for compatibility with webgl2.0, still does not work though 2017-02-22 19:14:21 -03:00
eska 6e1828c958 Fix WebAssembly builds on Windows 2017-02-21 23:21:28 +01:00
eska 6e2bf31e5a Automatically zip web export templates
Also fix web builds on Windows and clean up
2017-02-20 06:59:19 +01:00
eska 335fdea581 Fix parallel asm.js/WebAssembly builds 2017-02-20 03:44:37 +01:00
eska e06edc67c0 Enable WebGL2 in web export, start fixing build
Will not yet compile
2017-02-01 10:21:04 +01:00
eska 68422c5dd6 Relink web build when HTML shell changes
Emscripten injects its loader script when linking, so force relinking
whenever the HTML shell changes.

Also remove useless FULL_ES2 flag, which should be a linker flag, but
would impact performance too much.
2017-01-12 01:05:07 +01:00
eska 290d79f26c Emit asm.js code into a dedicated file for asm.js export
This helps prevent browser lockups during start-up at the cost of having
to distribute an extra file.
2016-11-30 23:47:38 +01:00
eska d87b1d1338 Remove explicit BINARYEN_METHOD for WebAssembly build
This option is the default since Binaryen version 21.
2016-11-13 15:38:12 +01:00
eska 82addf2ffe Enable memory growth in WebAssembly builds
This allows setting TOTAL_MEMORY during runtime at the cost of reserving
a bit more memory.
2016-11-13 15:29:03 +01:00