-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmeson.build
More file actions
79 lines (72 loc) · 3.14 KB
/
meson.build
File metadata and controls
79 lines (72 loc) · 3.14 KB
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
project(
'xf86-video-amdgpu',
'c',
version: '25.1.1',
license: 'MIT',
meson_version: '>=0.59.0',
default_options: ['warning_level=1']
)
# Dependencies
xorg_dep = dependency('xorg-server', version: '>=25.0.0', required: true)
xproto_dep = dependency('xproto', required: true)
fontsproto_dep = dependency('fontsproto', required: true)
xf86driproto_dep = dependency('xf86driproto', required: true)
randrproto_dep = dependency('randrproto', required: true)
renderproto_dep = dependency('renderproto', required: true)
videoproto_dep = dependency('videoproto', required: true)
xextproto_dep = dependency('xextproto', version: '>=7.1', required: true)
libdrm_dep = dependency('libdrm', version: '>=2.4.121', required: true)
libdrm_amdgpu_dep = dependency('libdrm_amdgpu', version: '>=2.4.121', required: true)
gbm_dep = dependency('gbm', required: true)
# Optional dependencies
libudev_dep = dependency('libudev', required: get_option('udev'))
libgl_dep = dependency('gl', required: true)
# Configurable directories
moduledir = join_paths(get_option('libdir'), get_option('moduledir'))
configdir = join_paths(get_option('prefix'), get_option('configdir'))
cc = meson.get_compiler('c')
have_gbm_bo_use_linear = cc.has_header_symbol('gbm.h', 'GBM_BO_USE_LINEAR')
have_gbm_bo_use_front_rendering = cc.has_header_symbol('gbm.h', 'GBM_BO_USE_FRONT_RENDERING')
xorg_include = xorg_dep.get_variable(pkgconfig: 'sdkdir')
have_fbGlyphs = cc.has_header('fbpict.h', args: ['-I' + xorg_include])
have_dri3_h = cc.has_header('dri3.h', args: ['-I' + xorg_include])
have_regionduplicate = cc.has_header('regionstr.h', args: ['-I' + xorg_include])
have_xf86CursorResetCursor = cc.has_header('xf86Cursor.h', args: ['-I' + xorg_include])
have_misyncshm = cc.has_header('misyncshm.h', args: ['-I' + xorg_include])
# Config header
version = meson.project_version()
varr = version.split('.')
major_version = varr[0]
minor_version = varr[1]
micro_version = varr[2]
config_h = configuration_data()
config_h.set('HAVE_DRI3_H', have_dri3_h ? 1 : 0)
config_h.set('HAVE_MISYNCSHM_H', have_misyncshm ? 1 : 0)
config_h.set('HAVE_FBGLYPHS', have_fbGlyphs ? 1 : 0)
config_h.set('HAVE_GBM_BO_USE_FRONT_RENDERING', have_gbm_bo_use_front_rendering ? 1 : 0)
config_h.set('HAVE_GBM_BO_USE_LINEAR', have_gbm_bo_use_linear ? 1 : 0)
config_h.set('HAVE_LIBUDEV', libudev_dep.found() ? 1 : 0)
config_h.set('HAVE_REGIONDUPLICATE', have_regionduplicate ? 1 : 0)
config_h.set('HAVE_XF86_CURSOR_RESET_CURSOR', have_xf86CursorResetCursor ? 1 : 0)
config_h.set('PACKAGE_NAME', meson.project_name())
config_h.set('PACKAGE_VERSION', version)
config_h.set('PACKAGE_VERSION_MAJOR', major_version)
config_h.set('PACKAGE_VERSION_MINOR', minor_version)
config_h.set('PACKAGE_VERSION_PATCHLEVEL', micro_version)
configure_file(
output: 'config.h',
configuration: config_h
)
subdir('src')
subdir('man')
subdir('conf')
summary({
'prefix': get_option('prefix'),
'exec_prefix': get_option('prefix'),
'libdir': get_option('libdir'),
'includedir': get_option('includedir'),
'configdir': configdir,
'moduledir': moduledir,
'CFLAGS': meson.get_compiler('c').get_supported_arguments(['-Wall']),
'LIBUDEV': libudev_dep,
}, section: 'Configuration')