]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/systemd/meson.build
Merge pull request #7411 from joergsteffens/tapechanger
[thirdparty/systemd.git] / src / systemd / meson.build
CommitLineData
3a726fcd 1# SPDX-License-Identifier: LGPL-2.1+
3a726fcd 2
fdd147a8 3_systemd_headers = '''
37efbbd8
ZJS
4 sd-bus.h
5 sd-bus-protocol.h
6 sd-bus-vtable.h
7 sd-daemon.h
3f608087 8 sd-device.h
37efbbd8 9 sd-event.h
6083c4b7 10 sd-hwdb.h
37efbbd8
ZJS
11 sd-id128.h
12 sd-journal.h
13 sd-login.h
14 sd-messages.h
fdd147a8
ZJS
15'''.split()
16
17# https://github.com/mesonbuild/meson/issues/1633
18systemd_headers = files(_systemd_headers)
5c23128d 19
d6263ee4
YW
20_not_installed_headers = '''
21 sd-dhcp6-client.h
22 sd-dhcp6-lease.h
23 sd-dhcp-client.h
24 sd-dhcp-lease.h
25 sd-dhcp-server.h
26 sd-ipv4acd.h
27 sd-ipv4ll.h
28 sd-lldp.h
29 sd-ndisc.h
30 sd-netlink.h
31 sd-network.h
32 sd-path.h
33 sd-radv.h
35f2cb28 34 sd-resolve.h
d6263ee4
YW
35 sd-utf8.h
36'''.split()
37
37ab1a25 38install_headers(
37efbbd8
ZJS
39 systemd_headers,
40 '_sd-common.h',
41 subdir : 'systemd')
fdd147a8
ZJS
42
43
44############################################################
45
d7f149c1
ZJS
46opts = [['c'],
47 ['c', '-ansi'],
aeaac7b5
ZJS
48 ['c', '-std=iso9899:1990'],
49 ['c', '-std=iso9899:2011']]
50
51if cc.has_argument('-std=iso9899:2017')
52 opts += [['c', '-std=iso9899:2017']]
53endif
ec36d052
DC
54
55cxx = find_program('c++', required : false)
56if cxx.found()
aeaac7b5
ZJS
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
ec36d052 66endif
fdd147a8 67
d6263ee4 68foreach header : _systemd_headers + _not_installed_headers
37efbbd8 69 foreach opt : opts
d7f149c1 70 name = ''.join([header, ':'] + opt)
938be089
ZJS
71 if want_tests != 'false'
72 test('cc-' + 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
37efbbd8 78 endforeach
fdd147a8 79endforeach