]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/systemd/meson.build
Merge pull request #10152 from yuwata/udev-use-extract
[thirdparty/systemd.git] / src / systemd / meson.build
1 # SPDX-License-Identifier: LGPL-2.1+
2
3 _systemd_headers = '''
4 sd-bus.h
5 sd-bus-protocol.h
6 sd-bus-vtable.h
7 sd-daemon.h
8 sd-device.h
9 sd-event.h
10 sd-hwdb.h
11 sd-id128.h
12 sd-journal.h
13 sd-login.h
14 sd-messages.h
15 '''.split()
16
17 # https://github.com/mesonbuild/meson/issues/1633
18 systemd_headers = files(_systemd_headers)
19
20 # sd-dhcp6-client.h
21 # sd-dhcp6-lease.h
22 # sd-dhcp-client.h
23 # sd-dhcp-lease.h
24 # sd-dhcp-server.h
25 # sd-ipv4acd.h
26 # sd-ipv4ll.h
27 # sd-lldp.h
28 # sd-ndisc.h
29 # sd-netlink.h
30 # sd-network.h
31 # sd-path.h
32 # sd-resolve.h
33 # sd-utf8.h
34
35 install_headers(
36 systemd_headers,
37 '_sd-common.h',
38 subdir : 'systemd')
39
40
41 ############################################################
42
43 opts = [['c'],
44 ['c', '-ansi'],
45 ['c', '-std=iso9899:1990'],
46 ['c', '-std=iso9899:2011']]
47
48 if cc.has_argument('-std=iso9899:2017')
49 opts += [['c', '-std=iso9899:2017']]
50 endif
51
52 cxx = find_program('c++', required : false)
53 if cxx.found()
54 opts += [['c++'],
55 ['c++', '-std=c++98'],
56 ['c++', '-std=c++11']]
57 if cc.has_argument('-std=c++14')
58 opts += [['c++', '-std=c++14']]
59 endif
60 if cc.has_argument('-std=c++17')
61 opts += [['c++', '-std=c++17']]
62 endif
63 endif
64
65 foreach header : _systemd_headers
66 foreach opt : opts
67 name = ''.join([header, ':'] + opt)
68 if want_tests != 'false'
69 test('cc-' + name,
70 check_compilation_sh,
71 args : cc.cmd_array() + ['-c', '-x'] + opt +
72 ['-Werror', '-include',
73 join_paths(meson.current_source_dir(), header)])
74 endif
75 endforeach
76 endforeach