mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-07 21:23:32 +00:00
build: Fixed simd options detection
This commit is contained in:
parent
1dd5e5c2ea
commit
e3eaa05548
3 changed files with 17 additions and 13 deletions
17
meson.build
17
meson.build
|
@ -40,12 +40,17 @@ if get_option('savers').contains('tvg_beta') == true
|
|||
config_h.set10('THORVG_TVG_SAVER_SUPPORT', true)
|
||||
endif
|
||||
|
||||
if get_option('vectors').contains('avx') == true
|
||||
config_h.set10('THORVG_AVX_VECTOR_SUPPORT', true)
|
||||
endif
|
||||
cpu_avx = false
|
||||
cpu_neon = false
|
||||
|
||||
if get_option('vectors').contains('neon') == true
|
||||
if get_option('use_simd') == true
|
||||
if host_machine.cpu_family() == 'x86' or host_machine.cpu_family() == 'x86_64'
|
||||
config_h.set10('THORVG_AVX_VECTOR_SUPPORT', true)
|
||||
cpu_avx = true
|
||||
elif host_machine.cpu_family() == 'arm'
|
||||
config_h.set10('THORVG_NEON_VECTOR_SUPPORT', true)
|
||||
cpu_neon = true
|
||||
endif
|
||||
endif
|
||||
|
||||
if get_option('bindings').contains('capi') == true
|
||||
|
@ -98,8 +103,8 @@ Summary:
|
|||
get_option('prefix'),
|
||||
get_option('engines').contains('sw'),
|
||||
get_option('engines').contains('gl'),
|
||||
get_option('vectors').contains('avx'),
|
||||
get_option('vectors').contains('neon'),
|
||||
cpu_avx,
|
||||
cpu_neon,
|
||||
get_option('loaders').contains('tvg_beta'),
|
||||
get_option('loaders').contains('svg'),
|
||||
get_option('loaders').contains('png'),
|
||||
|
|
|
@ -16,10 +16,9 @@ option('savers',
|
|||
value: [''],
|
||||
description: 'Enable File Savers in thorvg')
|
||||
|
||||
option('vectors',
|
||||
type: 'combo',
|
||||
choices: ['', 'avx', 'neon'],
|
||||
value: '',
|
||||
option('use_simd',
|
||||
type: 'boolean',
|
||||
value: true,
|
||||
description: 'Enable CPU Vectorization(SIMD) in thorvg')
|
||||
|
||||
option('bindings',
|
||||
|
|
|
@ -2,11 +2,11 @@ compiler_flags = ['-DTVG_BUILD']
|
|||
|
||||
cc = meson.get_compiler('cpp')
|
||||
if (cc.get_id() != 'msvc')
|
||||
if get_option('vectors').contains('avx')
|
||||
if cpu_avx
|
||||
compiler_flags += ['-mavx']
|
||||
endif
|
||||
if get_option('vectors').contains('neon')
|
||||
compiler_flags += ['-mfpu=neon-vfpv4']
|
||||
if cpu_neon
|
||||
compiler_flags += ['-mfpu=neon']
|
||||
endif
|
||||
if get_option('b_sanitize') == 'none'
|
||||
compiler_flags += ['-fno-exceptions', '-fno-rtti',
|
||||
|
|
Loading…
Add table
Reference in a new issue