Files
meson-mfem/web/meson.build

35 lines
1.0 KiB
Meson

wasm_browser_demo = []
if is_wasm and get_option('build_examples')
configure_file(input: 'index.html', output: 'index.html', copy: true)
configure_file(input: 'styles.css', output: 'styles.css', copy: true)
configure_file(input: 'demo.js', output: 'demo.js', copy: true)
wasm_browser_demo = executable(
'mfem-wasm-demo',
'wasm_demo.cpp',
dependencies: [mfem_dep, template_include_dep],
override_options: ['cpp_std=' + mfem_consumer_cpp_std],
link_args: [
'-sMODULARIZE=1',
'-sEXPORT_NAME=MFEMDemoModule',
'-sEXPORTED_FUNCTIONS=_main,_mfem_demo_solve,_mfem_demo_capabilities',
'-sEXPORTED_RUNTIME_METHODS=ccall',
'-sNO_EXIT_RUNTIME=1',
'-sENVIRONMENT=web,node',
],
install: false,
)
if get_option('build_tests')
node_program = find_program('node', required: true)
test(
'wasm-browser-api',
node_program,
args: [files('smoke.cjs'), wasm_browser_demo],
depends: wasm_browser_demo,
timeout: 120,
)
endif
endif