summaryrefslogtreecommitdiff
path: root/meson.build
blob: bb135eb5469a1aedbcbcaeb035446d0d8e45e43f (plain)
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
project('libvdpau', 'c', 'cpp', meson_version : '>=0.41')
cc = meson.get_compiler('c')

libdir = join_paths(get_option('prefix'), get_option('libdir'))
moduledir = get_option('moduledir')
if moduledir == ''
    moduledir = join_paths(libdir, 'vdpau')
endif
sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir'))

cdata = configuration_data()
cdata.set_quoted('VDPAU_MODULEDIR', moduledir)
cdata.set_quoted('VDPAU_SYSCONFDIR', sysconfdir)
cdata.set_quoted('VDPAU_DOC_PATH', meson.current_source_dir())
cdata.set_quoted('VDPAU_HEADER_PATH', join_paths(meson.source_root(), 'include'))

if cc.has_function('secure_getenv')
    cdata.set10('HAVE_SECURE_GETENV', true)
    cdata.set10('_GNU_SOURCE', true)
elif cc.has_function('__secure_getenv')
    cdata.set10('HAVE___SECURE_GETENV', true)
    cdata.set10('_GNU_SOURCE', true)
endif

dri2_option = get_option('dri2')
dri2_required = dri2_option == 'true'
dri2 = []
if dri2_option != 'false'
    dri2 += [
        dependency('dri2proto', version : '>= 2.2', required : dri2_required),
        dependency('xext', required : dri2_required),
    ]
endif

use_dri2 = dri2_option != 'false'
foreach dep : dri2
    use_dri2 = use_dri2 and dep.found()
endforeach
cdata.set10('DRI2', use_dri2)

configure_file(output : 'config.h', configuration : cdata)
add_project_arguments('-DHAVE_CONFIG_H', language : [ 'c', 'cpp' ])
inc = include_directories(['.', 'include'])

subdir('doc')
subdir('include')
subdir('src')
subdir('test')
subdir('trace')

import('pkgconfig').generate(
    name : 'VDPAU',
    filebase : 'vdpau',
    version : '1.5',
    description : 'The Video Decode and Presentation API for UNIX',
    libraries : '-L${libdir} -lvdpau',
    variables : 'moduledir=' + moduledir,
)