Emscripten fixes
This commit is contained in:
parent
4bffcfcc15
commit
875d841c52
2 changed files with 14 additions and 9 deletions
|
@ -13,7 +13,7 @@ var logOutputElement = E('output');
|
|||
var dlMessage = statusElement.innerText;
|
||||
logToggleElement.checked = false;
|
||||
|
||||
function toggleLog() {
|
||||
window['toggleLog'] = function toggleLog() {
|
||||
logContainerElement.hidden = !logToggleElement.checked;
|
||||
logOutputElement.scrollTop = logOutputElement.scrollHeight;
|
||||
}
|
||||
|
|
|
@ -167,6 +167,9 @@ if host_machine.system() == 'emscripten'
|
|||
em_link_outputs = []
|
||||
em_link_output_suffixes = ['html', 'wasm', 'js'] # first element is significant
|
||||
em_data_dir = config.get_unquoted('TAISEI_BUILDCONF_DATA_PATH')
|
||||
em_common_args = [
|
||||
'-s', 'STRICT=1',
|
||||
]
|
||||
em_link_args = [
|
||||
'-O@0@'.format(get_option('optimization')),
|
||||
'-s', 'ALLOW_MEMORY_GROWTH=1',
|
||||
|
@ -185,8 +188,8 @@ if host_machine.system() == 'emscripten'
|
|||
'-s', 'MAX_WEBGL_VERSION=2',
|
||||
'-s', 'MIN_WEBGL_VERSION=2',
|
||||
'-s', 'MODULARIZE=0',
|
||||
'-s', 'STRICT=1',
|
||||
'-s', 'WASM=1',
|
||||
'-s', 'LLD_REPORT_UNDEFINED',
|
||||
'-lGL',
|
||||
'-legl.js',
|
||||
'-lidbfs.js',
|
||||
|
@ -225,29 +228,31 @@ if host_machine.system() == 'emscripten'
|
|||
em_link_outputs += ['@0@.@1@'.format(taisei_basename, suffix)]
|
||||
endforeach
|
||||
|
||||
taisei = executable(taisei_basename, taisei_src, version_deps,
|
||||
libtaisei = static_library(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',
|
||||
c_pch : 'pch/taisei_pch.h',
|
||||
c_args : [em_common_args, taisei_c_args],
|
||||
install : false,
|
||||
)
|
||||
|
||||
taisei = static_library(taisei_basename + '-full',
|
||||
link_whole : libtaisei,
|
||||
)
|
||||
|
||||
taisei_html = custom_target(em_link_outputs[0],
|
||||
# NOTE: Unfortunately we can't just put 'taisei' directly into the command array.
|
||||
# Meson then makes an invalid assumption that we are going to execute it ("use as a generator"),
|
||||
# and aborts because there's no exe wrapper in the cross file (which wouldn't make sense to have).
|
||||
|
||||
command : [
|
||||
cc.cmd_array(),
|
||||
meson.get_compiler('cpp').cmd_array(),
|
||||
taisei.full_path(),
|
||||
'--pre-js', em_preamble,
|
||||
em_bundle_link_args,
|
||||
'--shell-file', em_shell,
|
||||
get_option('c_args'),
|
||||
get_option('c_link_args'),
|
||||
em_common_args,
|
||||
em_link_args,
|
||||
'-o', '@OUTPUT0@',
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue