Repository navigation
Expand file tree
/
Copy pathmeson.build
More file actions
79 lines (68 loc) · 2.11 KB
/
Copy pathmeson.build
File metadata and controls
79 lines (68 loc) · 2.11 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
munit_deps = []
munit_defs = []
if cc.get_id() == 'pgi'
munit_deps += dependency('openmp')
endif
if cc.has_function('clock_gettime')
librt_dep = cc.find_library('rt', required: false)
if not librt_dep.found()
munit_defs += '-DPSNIP_CLOCK_NO_LIBRT'
endif
munit_deps += librt_dep
endif
munit_cflags = []
if cc.has_argument('-w')
munit_cflags += '-w'
endif
munit = static_library('munit', 'munit/munit.c', dependencies: munit_deps, c_args: munit_cflags)
cc = meson.get_compiler('c')
libm = cc.find_library('m', required : false)
simde_c_defs = []
simde_cxx_defs = []
simde_c_args = []
simde_cxx_args = []
simde_deps = [libm]
c_openmp_simd = false
cxx_openmp_simd = false
foreach omp_arg : ['-fopenmp-simd', '-qopenmp-simd']
if (not c_openmp_simd) and cc.has_argument(omp_arg)
simde_c_args += omp_arg
simde_c_defs += '-DSIMDE_ENABLE_OPENMP'
c_openmp_simd = true
endif
if (not cxx_openmp_simd) and cxx.has_argument(omp_arg)
simde_cxx_args += omp_arg
simde_cxx_defs += '-DSIMDE_ENABLE_OPENMP'
cxx_openmp_simd = true
endif
endforeach
simde_native_c_flags = []
if cc.has_argument('-Wpsabi')
simde_native_c_flags += '-Wno-psabi'
endif
# if cc.has_argument('-march=native+simd')
# simde_native_c_flags += '-march=native+simd'
# elif cc.has_argument('-march=native')
# simde_native_c_flags += '-march=native'
# endif
simde_native_cxx_flags = []
if cxx.has_argument('-Wpsabi')
simde_native_cxx_flags += '-Wno-psabi'
endif
# if cxx.has_argument('-march=native+simd')
# simde_native_cxx_flags += '-march=native+simd'
# elif cxx.has_argument('-march=native')
# simde_native_cxx_flags += '-march=native'
# endif
if not c_openmp_simd
simde_deps += dependency('openmp', required: false)
endif
simde_include_dir = include_directories('..')
subdir('x86')
subdir('arm')
run_tests_exe = executable('run-tests', 'run-tests.c',
link_with: [munit, simde_tests_arm, simde_tests_x86],
dependencies: simde_deps,
c_args: simde_c_args + simde_c_defs + simde_native_c_flags,
cpp_args: simde_cxx_args + simde_cxx_defs + simde_native_cxx_flags)
test('run-tests', run_tests_exe)