forked from AkarinVS/vapoursynth-plugin
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmeson.build
More file actions
143 lines (122 loc) · 3.66 KB
/
Copy pathmeson.build
File metadata and controls
143 lines (122 loc) · 3.66 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
project('Plugin', 'c', 'cpp',
default_options: ['buildtype=release', 'b_ndebug=if-release', 'c_std=c99', 'cpp_std=c++20'],
meson_version: '>=0.64.0',
version: '1.5.0'
)
version_h = declare_dependency(
sources: vcs_tag(
command: ['git', 'describe', '--tags', '--long', '--always'],
input: 'version.h.in',
output: 'version.h'
)
)
is_windows = target_machine.system() == 'windows' or target_machine.system() == 'cygwin'
use_asmjit = get_option('asmjit')
static_llvm = get_option('static-llvm')
boost_charconv = get_option('boost-charconv')
sources_expr = [
# expr
'expr/vslog.cpp',
'expr/cpufeatures.cpp',
'expr/kernel/cpulevel.cpp',
'expr/exprfilter.cpp',
]
sources_expr2 = [
# expr2
'expr2/exprfilter.cpp',
'expr2/reactor/CPUID.cpp',
'expr2/reactor/Debug.cpp',
'expr2/reactor/ExecutableMemory.cpp',
'expr2/reactor/LLVMAsm.cpp',
'expr2/reactor/LLVMJIT.cpp',
'expr2/reactor/LLVMReactor.cpp',
'expr2/reactor/LLVMReactorDebugInfo.cpp',
'expr2/reactor/Reactor.cpp',
'expr2/reactor/ReactorDebugInfo.cpp',
]
sources_ngx = [
# DLISR
'ngx/ngx.cc',
'ngx/ngximpl.cc',
]
sources_vfx = [
# DLVFX
'vfx/vfx.cc',
'vfx/nvvfx/src/NVVideoEffectsProxy.cpp',
'vfx/nvvfx/src/nvCVImageProxy.cpp',
]
sources_banding = [
# Cambi
'banding/cambifilter.c',
'banding/libvmaf/picture.c',
'banding/libvmaf/cambi.c',
'banding/libvmaf/ref.c',
'banding/libvmaf/mem.c',
#'banding/libvmaf/opt.c',
#'banding/libvmaf/test.c',
#'banding/libvmaf/test_cambi.c',
]
sources_text = [
'text/textfilter.cpp',
'text/tmplfilter.cpp',
]
sources_common = [
# main plugin
'plugin.cpp',
]
deps = []
incdir = [include_directories('text')]
if use_asmjit
sources = sources_common + sources_expr
incdir += include_directories('.')
if host_machine.cpu_family().startswith('x86')
add_project_arguments('-DVS_TARGET_CPU_X86', '-mavx', language: 'cpp')
else
error('the asmjit backend only support x86.')
endif
else
sources = sources_common + sources_expr2
incdir += include_directories('expr2/reactor')
deps += dependency('llvm', version: ['>= 20', '< 23'], method: 'config-tool', static: static_llvm,
modules: [
'asmprinter', 'executionengine', 'target', 'orcjit', 'native',
])
if target_machine.system() == 'linux'
# GH-38: allocate JIT code via a named anonymous mmap instead of the heap.
add_project_arguments('-DREACTOR_ANONYMOUS_MMAP_NAME=akarin_jit', language: 'cpp')
endif
if static_llvm and is_windows
# HACK: work around multiple definition of `llvm::getTypeName<llvm::LICMPass>()::Name`.
add_project_link_arguments('-Wl,--allow-multiple-definition', language: 'cpp')
endif
endif
if boost_charconv
add_project_arguments('-DUSE_BOOST_CHARCONV', language: 'cpp')
deps += dependency('boost', modules: ['charconv'], static: get_option('prefer_static')) # boost dependencies do not respect prefer_static https://github.com/mesonbuild/meson/issues/15458
endif
libs = []
if is_windows
add_project_arguments('-DVS_TARGET_OS_WINDOWS', language: 'cpp')
# DLISR and DLVFX only supports Windows.
sources += sources_ngx + sources_vfx
incdir += include_directories('vfx/nvvfx/include')
add_project_arguments('-DHAVE_NGX', '-DHAVE_VFX', language: 'cpp')
endif
sources += sources_banding
sources += sources_text
py = import('python').find_installation(pure: false)
r = run_command(
py,
'-c',
'import vapoursynth as vs; print(vs.get_include())',
check: true,
)
inc_vs = include_directories(r.stdout().strip())
incdir += inc_vs
shared_module('akarin', sources,
dependencies: deps + [ version_h ],
link_with: libs,
install: false,
include_directories: incdir,
gnu_symbol_visibility: 'hidden'
)