Building for web using meson
This commit is contained in:
parent
66b5807368
commit
73c3e48c56
6 changed files with 74 additions and 11 deletions
|
|
@ -2,12 +2,26 @@ tests_src = files(
|
|||
'tests.d',
|
||||
)
|
||||
|
||||
exe = executable('decs-tests',
|
||||
tests_src,
|
||||
include_directories : [inc],
|
||||
d_args : args,
|
||||
link_args : link_args,
|
||||
dependencies : decs_dep,
|
||||
)
|
||||
|
||||
test('basic-tests', exe)
|
||||
if host_machine.cpu_family() != 'wasm32'
|
||||
exe = executable('decs-tests', tests_src,
|
||||
include_directories : [inc],
|
||||
dependencies : decs_dep,
|
||||
)
|
||||
|
||||
test('basic-tests', exe)
|
||||
else
|
||||
tests_lib = library('decs-tests', tests_src,
|
||||
include_directories : [inc],
|
||||
)
|
||||
emcc = find_program('emcc')
|
||||
args_wasm_web = ['-v', '-s', 'ALLOW_MEMORY_GROWTH=1', '-s', 'WASM_MEM_MAX=1024MB', '-s', 'MALLOC=dlmalloc', '-s', 'WASM=1']
|
||||
wasm_web = custom_target('wasm-web',
|
||||
command: [emcc, args_wasm_web, '-o', '@OUTPUT@', '@INPUT@'],
|
||||
input: [ecs_lib, tests_lib],
|
||||
output: ['index.html'],
|
||||
build_by_default: true,
|
||||
)
|
||||
summary('wasm-index', wasm_web.full_path())
|
||||
|
||||
endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue