Debian Codegraph @

test cases/common/147 simd/meson.build

raw
1 project('simd', 'c')
2
3 simd = import('unstable-simd')
4
5 cc = meson.get_compiler('c')
6
7 cdata = configuration_data()
8
9 if not meson.is_cross_build() and host_machine.cpu_family() == 'arm' and cc.get_id() == 'clang'
10 message('Adding -march=armv7 because assuming that this build happens on Raspbian.')
11 message('Its Clang seems to be misconfigured and does not support NEON by default.')
12 add_project_arguments('-march=armv7', language : 'c')
13 endif
14
15 if cc.get_id() == 'msvc' and cc.version().version_compare('<17')
16 error('MESON_SKIP_TEST VS2010 produces broken binaries on x86.')
17 endif
18
19 # FIXME add [a, b] = function()
20 rval = simd.check('mysimds',
21 mmx : 'simd_mmx.c',
22 sse : 'simd_sse.c',
23 sse2 : 'simd_sse2.c',
24 sse3 : 'simd_sse3.c',
25 ssse3 : 'simd_ssse3.c',
26 sse41 : 'simd_sse41.c',
27 sse42 : 'simd_sse42.c',
28 avx : 'simd_avx.c',
29 avx2 : 'simd_avx2.c',
30 neon : 'simd_neon.c',
31 compiler : cc,
32 include_directories : include_directories('include'))
33
34 simdlibs = rval[0]
35 cdata.merge_from(rval[1])
36
37 configure_file(output : 'simdconfig.h',
38 configuration : cdata)
39
40 p = executable('simdtest', 'simdchecker.c', 'fallback.c',
41 link_with : simdlibs)
42
43 test('simdtest', p)