-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmeson.build
41 lines (34 loc) · 1.21 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
project('VMAF', 'cpp',
default_options: ['buildtype=release', 'warning_level=2', 'b_lto=true', 'b_ndebug=if-release', 'cpp_std=c++17'],
license: 'MIT',
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)
libvmaf_dep = dependency('libvmaf', version: '>=2.3.1')
deps = [vapoursynth_dep, libvmaf_dep]
install_dir = vapoursynth_dep.get_variable(pkgconfig: 'libdir') / 'vapoursynth'
else
libvmaf_dep = cxx.find_library('libvmaf')
thread_dep = cxx.find_library('pthreads')
deps = [libvmaf_dep, thread_dep]
install_dir = get_option('libdir') / 'vapoursynth'
endif
sources = [
'VMAF/VMAF.cpp'
]
if host_machine.cpu_family().startswith('x86') and gcc_syntax
add_project_arguments('-mfpmath=sse', '-msse2', language: 'cpp')
endif
shared_module('vmaf', sources,
dependencies: deps,
install: true,
install_dir: install_dir,
gnu_symbol_visibility: 'hidden'
)