File: meson.build

package info (click to toggle)
libva-utils 2.22.0%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,152 kB
  • sloc: ansic: 49,282; cpp: 15,772; makefile: 369; sh: 27
file content (132 lines) | stat: -rw-r--r-- 3,284 bytes parent folder | download
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
project('libva-utils', 'c', 'cpp',
        version : '2.22.0',
        default_options : [
          'warning_level=2',
          'c_std=gnu99',
          'default_library=static',
        ],
        license : 'MIT',
        meson_version : '>= 0.42.0')

c = meson.get_compiler('c')

threads = dependency('threads')

libva_dep = dependency('libva', version: '>= 1.1.0')

libva_utils_flags = [ '-Wno-unused-parameter',
                      '-Wno-sign-compare' ]

backends = ''

# DRM
use_drm = false
drm_deps=[]
if get_option('drm') != 'false'
  require_drm = get_option('drm') == 'true'
  drm_deps = [
    dependency('libva-drm', version: libva_dep.version(), required: require_drm),
    dependency('libdrm', required: require_drm),
  ]
  use_drm = true
  foreach d : drm_deps
    if not d.found()
      use_drm = false
    endif
  endforeach
  if use_drm
    backends += ' drm'
    libva_utils_flags += [ '-DHAVE_VA_DRM=1' ]
  endif
endif

# X11
use_x11 = false
if get_option('x11') != 'false'
  require_x11 = get_option('x11') == 'true'
  x11_deps = [
    dependency('x11', required: require_x11),
    dependency('libva-x11', version: libva_dep.version(), required: require_x11),
  ]
  use_x11 = true
  foreach d : x11_deps
    if not d.found()
      use_x11 = false
    endif
  endforeach
  if use_x11
    backends += ' x11'
    libva_utils_flags += [ '-DHAVE_VA_X11=1' ]
  endif
endif

# WAYLAND
use_wayland = false
if get_option('wayland') != 'false'
  require_wayland = get_option('wayland') == 'true'
  wayland_deps = [
    dependency('wayland-client', version: '>= 1.0.0', required: require_wayland),
    dependency('libva-wayland', version: libva_dep.version(), required: require_wayland),
  ]
  use_wayland = true
  foreach d : wayland_deps
    if not d.found()
      use_wayland = false
    endif
  endforeach
  if use_wayland
    backends += ' wayland'
    libva_utils_flags += [ '-DHAVE_VA_WAYLAND=1' ]
  endif
endif

# WIN32
use_win32 = false
if get_option('win32') != 'false'
  require_win32 = get_option('win32') == 'true'
  use_win32 = dependency('libva-win32', version: libva_dep.version(), required: require_win32).found()
  if use_win32
    libva_utils_flags = [ '-DHAVE_VA_WIN32=1', '-DNOMINMAX']
    dep_dxheaders = dependency('directx-headers', required : false)
    if not dep_dxheaders.found()
      dep_dxheaders = dependency('DirectX-Headers',
        version : '>= v1.0.2',
        fallback : ['DirectX-Headers', 'dep_dxheaders'],
        required : use_win32
      )
    endif
  endif
endif

add_project_arguments(libva_utils_flags,
                      language: ['c', 'cpp'])

if use_win32
  subdir('getopt')
  win32_deps = [ dependency('libva-win32', required: require_win32), idep_getopt, dep_dxheaders]
endif

subdir('common') # Uses win32_deps
subdir('vainfo')

if not use_win32
  subdir('decode')
  subdir('encode')
  subdir('putsurface')
  subdir('videoprocess')
  subdir('vendor/intel')
  subdir('vendor/intel/sfcsample')
endif

if get_option('tests')
  subdir('test')
endif

if meson.version().version_compare('>= 0.53')
  summary({
    'Libva VA-API version' : libva_dep.version(),
    'Installation prefix' : get_option('prefix'),
    'Extra window systems' : backends,
    'Enable Unit-tests': get_option('tests')
  }, bool_yn: true)
endif