update for building with latest emscripten

This commit is contained in:
Andrei Alexeyev 2020-04-10 06:09:36 +03:00
parent 72c61462a3
commit 0928f0be98
No known key found for this signature in database
GPG key ID: 363707CD4C7FE8A4
2 changed files with 4 additions and 22 deletions

View file

@ -42,24 +42,6 @@ cc = meson.get_compiler('c')
python3 = import('python3').find_python()
macos_app_bundle = get_option('macos_bundle') and host_machine.system() == 'darwin'
if cc.get_id() == 'emscripten'
# emscripten LTO is really tricky
# this logic should really be in Meson
if get_option('b_lto')
emscripten_global_link_args = [
'--llvm-lto', '1',
'-flto',
]
else
emscripten_global_link_args = []
endif
add_global_arguments(emscripten_global_link_args, language : 'c', native : false)
add_global_arguments(emscripten_global_link_args, language : 'cpp', native : false)
add_global_link_arguments(emscripten_global_link_args, language : 'c', native : false)
add_global_link_arguments(emscripten_global_link_args, language : 'cpp', native : false)
endif
subdir('scripts')
config = configuration_data()

View file

@ -170,8 +170,7 @@ if host_machine.system() == 'emscripten'
'-s', 'ALLOW_MEMORY_GROWTH=1',
'-s', 'ENVIRONMENT=web',
'-s', 'EXIT_RUNTIME=0',
# NOTE: the _SDL_LoadWAV_RW is an LTO workaround; we don't actually care about that function.
'-s', 'EXPORTED_FUNCTIONS=["_main", "_vfs_sync_callback", "_SDL_LoadWAV_RW"]',
'-s', 'EXPORTED_FUNCTIONS=["_main", "_vfs_sync_callback"]',
'-s', 'EXTRA_EXPORTED_RUNTIME_METHODS=["ccall"]',
'-s', 'FILESYSTEM=1',
'-s', 'FORCE_FILESYSTEM=1',
@ -182,7 +181,7 @@ if host_machine.system() == 'emscripten'
'-s', 'MIN_WEBGL_VERSION=2',
'-s', 'MODULARIZE=0',
'-s', 'STRICT=1',
'-s', 'TOTAL_MEMORY=268435456',
'-s', 'INITIAL_MEMORY=268435456',
'-s', 'WASM=1',
'-lGL',
'-legl.js',
@ -225,6 +224,8 @@ if host_machine.system() == 'emscripten'
taisei = executable(taisei_basename, taisei_src, version_deps,
dependencies : taisei_deps,
c_args : taisei_c_args,
# This fails; see https://github.com/emscripten-core/emscripten/issues/10872
# c_pch : 'pch/taisei_pch.h',
link_args : em_link_args,
name_suffix : 'bc',
install : false,
@ -238,7 +239,6 @@ if host_machine.system() == 'emscripten'
command : [
cc.cmd_array(),
taisei.full_path(),
emscripten_global_link_args,
'--pre-js', em_preamble,
em_bundle_link_args,
'--shell-file', em_shell,