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