forked from intel/intel-vaapi-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
107 lines (90 loc) · 3.24 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
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
project(
'intel-vaapi-driver', 'c',
version : '2.4.0.1',
meson_version : '>= 0.43.0',
default_options : [ 'warning_level=1',
'buildtype=debugoptimized' ])
version_arr = meson.project_version().split('.')
intel_vaapi_driver_major_version = version_arr[0]
intel_vaapi_driver_minor_version = version_arr[1]
intel_vaapi_driver_micro_version = version_arr[2]
intel_vaapi_driver_version = '@0@.@1@.@2@'.format(intel_vaapi_driver_major_version,
intel_vaapi_driver_minor_version,
intel_vaapi_driver_micro_version)
if version_arr.length() == 4
intel_vaapi_driver_pre_version = version_arr[3]
intel_vaapi_driver_version = '@[email protected]@1@'.format(intel_vaapi_driver_version,
intel_vaapi_driver_pre_version)
endif
cc = meson.get_compiler('c')
dl_dep = cc.find_library('dl')
mathlib_dep = cc.find_library('m', required : false)
git = find_program('git', required : false)
thread_dep = dependency('threads')
libdrm_dep = dependency('libdrm', version : '>= 2.4.52')
libdrm_intel_dep = dependency('libdrm_intel')
libva_version = '>= 1.1.0'
libva_dep = dependency('libva', version : libva_version,
fallback : [ 'libva', 'libva_dep' ])
if get_option ('enable_tests')
libva_drm_dep = dependency('libva-drm', version : libva_version,
fallback : [ 'libva', 'libva_drm_dep' ])
endif
va_api_major_version = '0'
va_api_minor_version = '33'
driverdir = get_option('driverdir')
if libva_dep.type_name() == 'pkgconfig'
if driverdir == ''
driverdir = libva_dep.get_pkgconfig_variable('driverdir')
endif
va_api_version_array = libva_dep.version().split('.')
va_api_major_version = va_api_version_array[0]
va_api_minor_version = va_api_version_array[1]
else
libva = subproject('libva')
if driverdir == ''
driverdir = libva.get_variable('driverdir')
endif
va_api_major_version = libva.get_variable('va_api_major_version')
va_api_minor_version = libva.get_variable('va_api_minor_version')
endif
if driverdir == ''
driverdir = '@0@/@1@/@2@'.format(get_option('prefix'), get_option('libdir'), 'dri')
endif
va_driver_init_func = '__vaDriverInit_@0@_@1@'.format(va_api_major_version,
va_api_minor_version)
WITH_X11 = false
if get_option('with_x11') != 'no'
libva_x11_dep = dependency(
'libva-x11',
version : libva_version,
required : get_option('with_x11') == 'yes')
WITH_X11 = libva_x11_dep.found()
endif
WITH_WAYLAND = false
if get_option('with_wayland') != 'no'
wayland_client_dep = dependency(
'wayland-client',
version : '>= 1.11.0',
required : get_option('with_wayland') == 'yes')
if wayland_client_dep.found()
prefix = wayland_client_dep.get_pkgconfig_variable('prefix')
wayland_scanner = join_paths(prefix, 'bin', 'wayland-scanner')
else
wayland_scanner = ''
endif
wl_scanner = find_program('wayland-scanner', wayland_scanner,
required : get_option('with_wayland') == 'yes')
libva_wayland_dep = dependency(
'libva-wayland',
version : libva_version,
required : get_option('with_wayland') == 'yes')
WITH_WAYLAND = (wayland_client_dep.found()
and wl_scanner.found()
and libva_wayland_dep.found())
endif
subdir('src')
if get_option('enable_tests')
srcdir = include_directories('src')
subdir('test')
endif