wasm support
This commit is contained in:
12
meson.build
12
meson.build
@@ -11,6 +11,12 @@ if not py_version.version_compare('>=3.6')
|
||||
endif
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
if get_option('wasm_build')
|
||||
add_project_arguments('--target=wasm32', language: 'c')
|
||||
add_project_arguments(['-nostdlib', '-fvisibility=default'], language: 'c')
|
||||
|
||||
endif
|
||||
|
||||
if cc.has_argument('-fstrict-aliasing')
|
||||
add_project_arguments('-fstrict-aliasing', language: 'c')
|
||||
endif
|
||||
@@ -99,11 +105,13 @@ fadec = declare_dependency(link_with: libfadec,
|
||||
sources: tables)
|
||||
install_headers(headers)
|
||||
|
||||
foreach component : components
|
||||
if get_option('wasm_build') == false
|
||||
foreach component : components
|
||||
test(component, executable('@0@-test'.format(component),
|
||||
'@0@-test.c'.format(component),
|
||||
dependencies: fadec))
|
||||
endforeach
|
||||
endforeach
|
||||
endif
|
||||
|
||||
if meson.version().version_compare('>=0.54.0')
|
||||
meson.override_dependency('fadec', fadec)
|
||||
|
||||
@@ -4,3 +4,4 @@ option('with_decode', type: 'boolean', value: true)
|
||||
option('with_encode', type: 'boolean', value: true)
|
||||
# encode2 is off-by-default to reduce size and compile-time
|
||||
option('with_encode2', type: 'boolean', value: false)
|
||||
option('wasm_build', type: 'boolean', value: false)
|
||||
Reference in New Issue
Block a user