-
-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathmeson.build
More file actions
81 lines (73 loc) · 1.85 KB
/
Copy pathmeson.build
File metadata and controls
81 lines (73 loc) · 1.85 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
80
81
# SPDX-License-Identifier: ISC
project(
'libudev-zero',
'c',
version: '1.0.4',
license: 'ISC',
meson_version: '>=0.60.0',
default_options: [
'c_std=c99',
'warning_level=2',
'default_library=both',
],
)
cc = meson.get_compiler('c')
usb_ids_path = get_option('usb-ids-path')
if usb_ids_path == ''
usb_ids_path = get_option('prefix') / get_option('datadir') / 'hwdata' / 'usb.ids'
endif
add_project_arguments(
'-D_XOPEN_SOURCE=700',
'-DUSB_IDS_PATH="@0@"'.format(usb_ids_path),
cc.get_supported_arguments(
'-Wpedantic',
'-Wmissing-prototypes',
'-Wstrict-prototypes',
'-Wno-unused-parameter',
),
language: 'c',
)
symbol_versioning = get_option('symbol-versioning')
libudev_link_args = []
libudev_link_depends = []
if symbol_versioning.allowed()
version_script = '-Wl,--version-script,@0@'.format(
meson.current_source_dir() / 'libudev.sym',
)
if cc.has_link_argument(version_script)
libudev_link_args += version_script
libudev_link_depends += files('libudev.sym')
elif symbol_versioning.enabled()
error('symbol-versioning was enabled, but the linker does not support --version-script')
endif
endif
libudev = library(
'udev',
files(
'udev.c',
'udev_device.c',
'udev_enumerate.c',
'udev_list.c',
'udev_monitor.c',
),
soversion: '1',
link_args: libudev_link_args,
link_depends: libudev_link_depends,
install: true,
)
install_headers(
configure_file(
input: 'udev.h',
output: 'libudev.h',
copy: true,
),
)
pkg = import('pkgconfig')
pkg.generate(
libudev,
name: 'libudev',
filebase: 'libudev',
description: 'Daemonless replacement for libudev',
url: 'https://github.com/illiliti/libudev-zero',
version: '251',
)