File: meson.build

package info (click to toggle)
simde 0.8.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie, trixie-backports
  • size: 58,264 kB
  • sloc: ansic: 817,393; sh: 315; makefile: 45; python: 26
file content (73 lines) | stat: -rw-r--r-- 1,935 bytes parent folder | download | duplicates (4)
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
cc = meson.get_compiler('c')
libm = cc.find_library('m', required : false)

simde_c_defs = ['-DSIMDE_CONSTRAINED_COMPILATION']
simde_cxx_defs = ['-DSIMDE_CONSTRAINED_COMPILATION']
simde_c_args = []
simde_cxx_args = []
simde_deps = [libm]

if get_option('sleef').enabled() or meson.get_external_property('sleef', false)
  sleef = cc.find_library('sleef', required: true)
  simde_deps += sleef
  simde_c_defs = ['-DSIMDE_MATH_SLEEF_ENABLE']
  simde_cxx_defs = ['-DSIMDE_MATH_SLEEF_ENABLE']
endif

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

if cc.get_id() == 'intel'
  simde_native_c_flags += '-DSIMDE_FAST_MATH'
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 cxx.get_id() == 'intel'
  simde_native_cxx_flags += '-DSIMDE_FAST_MATH'
endif

if not c_openmp_simd
  simde_deps += dependency('openmp', required: false)
endif

simde_deps += cc.find_library('m', required: false)

simde_include_dir = include_directories('..')

subdir('common')
subdir('x86')
subdir('arm')
subdir('wasm')
subdir('mips')