forked from Irrational-Encoding-Wizardry/descale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
60 lines (49 loc) · 1.73 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
project('Descale', 'c',
default_options: ['buildtype=release', 'b_ndebug=if-release', 'c_std=c99'],
meson_version: '>=0.51.0',
version: '6'
)
cc = meson.get_compiler('c')
sources = ['src/descale.c']
libs = []
deps = []
# Don't require VS to be installed on Windows,
# so we don't need to have VS fully installed
# in our mingw environment. Just the header files
# are enough.
if host_machine.system() == 'windows'
# Statically link things on Windows.
deps += cc.find_library('m', static: true, required: false)
deps += cc.find_library('winpthread', static: true)
installdir = join_paths(get_option('libdir'), 'vapoursynth')
else
deps += cc.find_library('m', required: false)
deps += cc.find_library('pthread')
vs = dependency('vapoursynth').partial_dependency(compile_args: true, includes: true)
deps += vs
installdir = join_paths(vs.get_pkgconfig_variable('libdir'), 'vapoursynth')
endif
if host_machine.cpu_family().startswith('x86')
add_project_arguments('-DDESCALE_X86', '-mfpmath=sse', '-msse2', language : 'c')
sources += ['src/x86/cpuinfo_x86.c']
libs += static_library('descale_avx', 'src/x86/descale_avx.c',
dependencies: deps,
c_args: ['-mavx'],
pic: true,
include_directories: 'src'
)
libs += static_library('descale_avx2', 'src/x86/descale_avx2.c',
dependencies: deps,
c_args: ['-mavx2', '-mfma'],
pic: true,
include_directories: 'src'
)
endif
shared_module('descale', sources,
dependencies: deps,
include_directories: 'src',
link_with: libs,
name_prefix: 'lib',
install: true,
install_dir: installdir
)