-
Notifications
You must be signed in to change notification settings - Fork 5
/
meson.build
82 lines (71 loc) · 2.42 KB
/
meson.build
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
80
81
82
project('AddGrain', 'cpp',
default_options: ['buildtype=release', 'warning_level=2', 'b_lto=true', 'b_ndebug=if-release', 'cpp_std=c++17'],
license: 'GPL-3.0-or-later',
meson_version: '>=0.51.0',
version: '10'
)
cxx = meson.get_compiler('cpp')
gcc_syntax = cxx.get_argument_syntax() == 'gcc'
if get_option('buildtype') == 'release'
add_project_arguments(gcc_syntax ? ['-fno-math-errno', '-fno-trapping-math'] : '/GS-', language: 'cpp')
endif
if gcc_syntax
vapoursynth_dep = dependency('vapoursynth', version: '>=55').partial_dependency(compile_args: true, includes: true)
install_dir = vapoursynth_dep.get_variable(pkgconfig: 'libdir') / 'vapoursynth'
else
vapoursynth_dep = []
install_dir = get_option('libdir') / 'vapoursynth'
endif
sources = [
'AddGrain/AddGrain.cpp',
'AddGrain/AddGrain.h'
]
libs = []
if host_machine.cpu_family().startswith('x86')
project_args = ['-DADDGRAIN_X86']
if gcc_syntax
project_args += ['-mfpmath=sse', '-msse2']
endif
add_project_arguments(project_args, language: 'cpp')
sources += [
'AddGrain/AddGrain_SSE2.cpp',
'AddGrain/VCL2/instrset.h',
'AddGrain/VCL2/instrset_detect.cpp',
'AddGrain/VCL2/vector_convert.h',
'AddGrain/VCL2/vectorclass.h',
'AddGrain/VCL2/vectorf128.h',
'AddGrain/VCL2/vectorf256.h',
'AddGrain/VCL2/vectorf256e.h',
'AddGrain/VCL2/vectorf512.h',
'AddGrain/VCL2/vectorf512e.h',
'AddGrain/VCL2/vectori128.h',
'AddGrain/VCL2/vectori256.h',
'AddGrain/VCL2/vectori256e.h',
'AddGrain/VCL2/vectori512.h',
'AddGrain/VCL2/vectori512e.h',
'AddGrain/VCL2/vectori512s.h',
'AddGrain/VCL2/vectori512se.h',
'AddGrain/VCL2/vectormath_common.h',
'AddGrain/VCL2/vectormath_exp.h',
'AddGrain/VCL2/vectormath_hyp.h',
'AddGrain/VCL2/vectormath_lib.h',
'AddGrain/VCL2/vectormath_trig.h'
]
libs += static_library('avx2', 'AddGrain/AddGrain_AVX2.cpp',
cpp_args: gcc_syntax ? ['-mavx2', '-mfma'] : '/arch:AVX2',
dependencies: vapoursynth_dep,
gnu_symbol_visibility: 'hidden'
)
libs += static_library('avx512', 'AddGrain/AddGrain_AVX512.cpp',
cpp_args: gcc_syntax ? ['-mavx512f', '-mavx512bw', '-mavx512dq', '-mavx512vl', '-mfma'] : '/arch:AVX512',
dependencies: vapoursynth_dep,
gnu_symbol_visibility: 'hidden'
)
endif
shared_module('addgrain', sources,
dependencies: vapoursynth_dep,
link_with: libs,
install: true,
install_dir: install_dir,
gnu_symbol_visibility: 'hidden'
)