forked from libexpat/libexpat
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
64 lines (55 loc) · 1.57 KB
/
meson.build
File metadata and controls
64 lines (55 loc) · 1.57 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
project('libexpat.wasm', 'c', version: '2.6.4', meson_version: '>=1.3.0')
simd = get_option('simd')
incs = include_directories('.', 'expat/lib')
core_sources = files(
'expat/lib/xmlparse.c',
'expat/lib/xmlrole.c',
'expat/lib/xmltok.c',
'expat/lib/xmltok_impl.c',
'expat/lib/xmltok_ns.c',
)
cargs = []
if simd
cargs += ['-msimd128']
endif
executable('expat-main',
files('wasm/expat_wasm_module.c') + core_sources,
include_directories: incs,
c_args: cargs,
link_args: [
'-sWASM=1','-sMODULARIZE=1','-sEXPORT_ES6=1','-sEXPORT_NAME=ExpatModule',
'-sALLOW_MEMORY_GROWTH=1','-sNO_FILESYSTEM=1',
'-sEXPORTED_RUNTIME_METHODS=["cwrap","ccall","UTF8ToString"]',
'-O3','-flto',
],
install: true,
install_dir: get_option('bindir')
)
shared_module('expat-side',
files('wasm/expat_wasm_side.c') + core_sources,
include_directories: incs,
name_prefix: '',
name_suffix: 'wasm',
c_args: cargs,
link_args: [
'-sSIDE_MODULE=2','-fPIC','-O3','-flto',
'-sERROR_ON_UNDEFINED_SYMBOLS=0', # Host provides dependencies
'-sEXPORTED_FUNCTIONS=["_expat_wasm_version"]',
],
install: true,
install_dir: get_option('libdir')
)
static_library('expat',
core_sources,
include_directories: incs,
c_args: cargs,
install: true,
install_dir: get_option('libdir')
)
# Generate WASM manifest after build
manifest_script = find_program('../../../../scripts/generate-manifest-meson.sh', required: false)
if manifest_script.found()
run_target('manifest',
command: [manifest_script, meson.project_source_root(), meson.project_build_root()]
)
endif