forked from facebook/zstd
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
42 lines (35 loc) · 1.21 KB
/
meson.build
File metadata and controls
42 lines (35 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
project('zstd.wasm', 'c', version: '1.5.6', meson_version: '>=1.3.0', default_options: ['buildtype=release'])
fs = import('fs')
if get_option('simd')
add_project_arguments('-msimd128', language: 'c')
endif
incs = include_directories('lib')
core_sources = []
core_sources += fs.glob('lib/common/*.c')
core_sources += fs.glob('lib/compress/*.c')
core_sources += fs.glob('lib/decompress/*.c')
core_sources += fs.glob('lib/dictBuilder/*.c')
core = static_library('zstd_core', core_sources, include_directories: incs)
if get_option('main_module')
executable('zstd-main', 'src/zstd_wasm_module.c',
link_with: core,
include_directories: incs,
install: true,
link_args: [
'--no-entry',
'-sMODULARIZE=1',
'-sEXPORT_ES6=1',
'-sALLOW_MEMORY_GROWTH=1',
'-sENVIRONMENT=web,webview,worker',
'-sNO_FILESYSTEM=1',
'-sEXPORTED_RUNTIME_METHODS=["cwrap","ccall","UTF8ToString"]',
'-sEXPORTED_FUNCTIONS=@' + meson.project_source_root() / get_option('exports'),
])
endif
if get_option('side_module')
shared_module('zstd-side', 'src/zstd_wasm_side.c',
link_whole: core,
include_directories: incs,
install: true,
link_args: ['-sSIDE_MODULE=2', '-fPIC'])
endif