@@ -46,17 +46,20 @@ if build_application
4646 endif
4747
4848 if not fs.exists(APP_ROMFS)
49- error (' APP_ROMFS should exist, but doesn\' t: \' ' + APP_ROMFS + ' \' ' )
49+ error (
50+ ' APP_ROMFS should exist, but doesn\' t: \' '
51+ + APP_ROMFS
52+ + ' \' ' ,
53+ )
5054 endif
5155
52- emscripten_link_args += [' --preload-file' , APP_ROMFS+ ' @/assets/' ]
56+ emscripten_link_args += [' --preload-file' , APP_ROMFS + ' @/assets/' ]
5357
5458 endif
5559
56-
5760 emscripten_name = ' oopetris'
5861 emscripten_deps = [liboopetris_graphics_dep, graphic_application_deps]
59-
62+
6063 emscripten_options = {
6164 ' warning_level' : ' 3' ,
6265 ' werror' : true ,
@@ -80,6 +83,7 @@ if build_application
8083 override_options : emscripten_options,
8184 install : true ,
8285 name_suffix : ' html' ,
86+ link_depends : [oopetris_js],
8387 )
8488
8589 python3 = find_program (' python3' , required : false )
@@ -100,6 +104,21 @@ if build_application
100104
101105 endif
102106
107+ wasm_validate_exe = find_program (' wasm-validate' , required : false )
108+
109+ if wasm_validate_exe.found()
110+
111+ wasm_file = meson .project_build_root() / ' src' / ' executables' / ' oopetris.wasm'
112+
113+ test (
114+ ' validate wasm file' ,
115+ wasm_validate_exe,
116+ args : [' --enable-threads' , wasm_file],
117+ depends : [oopetris_js, oopetris_html],
118+
119+ )
120+ endif
121+
103122 else
104123 error (' Unhandled cross built system: ' + host_machine .system())
105124 endif
0 commit comments