]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/systemd/meson.build
Merge pull request #15252 from ssahani/dhcpv6-mud
[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 sd-path.h
16 '''.split()
17
18 # https://github.com/mesonbuild/meson/issues/1633
19 systemd_headers = files(_systemd_headers)
20
21 _not_installed_headers = '''
22 sd-dhcp6-client.h
23 sd-dhcp6-lease.h
24 sd-dhcp-client.h
25 sd-dhcp-lease.h
26 sd-dhcp-option.h
27 sd-dhcp-server.h
28 sd-ipv4acd.h
29 sd-ipv4ll.h
30 sd-lldp.h
31 sd-ndisc.h
32 sd-netlink.h
33 sd-network.h
34 sd-radv.h
35 sd-resolve.h
36 sd-utf8.h
37 '''.split()
38
39 install_headers(
40 systemd_headers,
41 '_sd-common.h',
42 subdir : 'systemd')
43
44
45 ############################################################
46
47 opts = [['c'],
48 ['c', '-ansi'],
49 ['c', '-std=iso9899:1990'],
50 ['c', '-std=iso9899:2011']]
51
52 if cc.has_argument('-std=iso9899:2017')
53 opts += [['c', '-std=iso9899:2017']]
54 endif
55
56 if add_languages('cpp', required : false)
57 opts += [['c++'],
58 ['c++', '-std=c++98'],
59 ['c++', '-std=c++11']]
60 if cc.has_argument('-std=c++14')
61 opts += [['c++', '-std=c++14']]
62 endif
63 if cc.has_argument('-std=c++17')
64 opts += [['c++', '-std=c++17']]
65 endif
66 endif
67
68 foreach header : _systemd_headers + _not_installed_headers + ['../libudev/libudev.h']
69 foreach opt : opts
70 name = ''.join(['cc-', header.split('/')[-1], ':'] + opt)
71 if want_tests != 'false'
72 test(name,
73 check_compilation_sh,
74 args : cc.cmd_array() + ['-c', '-x'] + opt +
75 ['-Werror', '-include',
76 join_paths(meson.current_source_dir(), header)])
77 endif
78 endforeach
79 endforeach