File tree Expand file tree Collapse file tree 4 files changed +70
-0
lines changed
Expand file tree Collapse file tree 4 files changed +70
-0
lines changed Original file line number Diff line number Diff line change 1+ option('main_module', type: 'boolean', value: true)
2+ option('side_module', type: 'boolean', value: true)
3+ option('simd', type: 'boolean', value: true)
Original file line number Diff line number Diff line change 1+ [binaries]
2+ c = 'emcc'
3+ cpp = 'em++'
4+ ar = 'emar'
5+ ranlib = 'emranlib'
6+ strip = 'llvm-strip'
7+ pkgconfig = 'em-pkg-config'
8+
9+ [built-in options]
10+ c_args = []
11+ c_link_args = []
12+
13+ [host_machine]
14+ system = 'emscripten'
15+ cpu_family = 'wasm32'
16+ cpu = 'wasm32'
17+ endian = 'little'
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ import os , sys , shutil
3+
4+ def main ():
5+ prefix = os .environ .get ('MESON_INSTALL_DESTDIR_PREFIX' ) or (sys .argv [1 ] if len (sys .argv ) > 1 else None )
6+ if not prefix :
7+ prefix = os .getcwd ()
8+ wasm_dir = os .path .join (prefix , 'wasm' )
9+ if not os .path .isdir (wasm_dir ):
10+ return 0
11+ target = os .path .join (wasm_dir , 'libjpeg-turbo-side.wasm' )
12+ if os .path .exists (target ):
13+ return 0
14+ for f in os .listdir (wasm_dir ):
15+ if f .endswith ('.wasm' ):
16+ shutil .copy2 (os .path .join (wasm_dir ,f ), target )
17+ break
18+ return 0
19+
20+ if __name__ == '__main__' :
21+ raise SystemExit (main ())
22+
Original file line number Diff line number Diff line change 1+ /*
2+ * wasm_compat_side.c - SIDE_MODULE compatibility layer for libjpeg-turbo
3+ * Copyright (c) 2025 Superstruct Ltd, New Zealand
4+ * Licensed under same license as libjpeg-turbo
5+ */
6+
7+ #include <emscripten.h>
8+
9+ /* SIDE_MODULE export declarations for libjpeg-turbo */
10+ EMSCRIPTEN_KEEPALIVE int wasm_side_module_init (void ) {
11+ return 1 ; /* Success */
12+ }
13+
14+ EMSCRIPTEN_KEEPALIVE const char * wasm_side_module_version (void ) {
15+ return "3.1.2-wasm-native" ;
16+ }
17+
18+ /* Forward declarations for SIDE_MODULE exports */
19+ extern int jpeg_wasm_init (void );
20+ extern void jpeg_wasm_cleanup (void );
21+
22+ EMSCRIPTEN_KEEPALIVE int libjpeg_turbo_side_init (void ) {
23+ return jpeg_wasm_init ();
24+ }
25+
26+ EMSCRIPTEN_KEEPALIVE void libjpeg_turbo_side_cleanup (void ) {
27+ jpeg_wasm_cleanup ();
28+ }
You can’t perform that action at this time.
0 commit comments