Merge branch 'wasm_demos' into 'master'

Support compiling demos in wasm build

See merge request Mergul/bubel-ecs!14
This commit is contained in:
mmcomando 2022-07-09 08:45:13 +00:00
commit fdc1fc536e
11 changed files with 156 additions and 43 deletions

View file

@ -10,12 +10,23 @@ tests_src = files(
'vector.d'
)
exe = executable('decs-tests',
tests_src,
include_directories : [inc, include_directories('..')],
d_args : args,
link_args : link_args,
dependencies : decs_dep,
)
if host_machine.cpu_family() != 'wasm32'
exe = executable('decs-tests', tests_src,
include_directories : [inc, '..'],
dependencies : decs_dep,
)
test('basic-tests', exe)
test('basic-tests', exe)
else
tests_lib = library('decs-tests', tests_src,
include_directories : [inc],
d_module_versions : ['ECSEmscripten'],
)
wasm_web = custom_target('wasm-web',
command: [emcc, args_wasm, '-o', '@OUTPUT@', '@INPUT@'],
input: [ecs_lib, tests_lib],
output: ['index.html'],
build_by_default: true,
)
summary('wasm-index', wasm_web.full_path())
endif