summaryrefslogtreecommitdiff
path: root/src/systemd/meson.build
blob: aa43dedac20471f5cc8fa1e518b04e96f1abd9fd (plain)
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
#if 0 /// No systemd-journal in elogind ...
# _systemd_headers = '''
#         sd-bus.h
#         sd-bus-protocol.h
#         sd-bus-vtable.h
#         sd-daemon.h
#         sd-event.h
#         sd-id128.h
#         sd-journal.h
#         sd-login.h
#         sd-messages.h
# '''.split()
#else
_systemd_headers = '''
        sd-bus.h
        sd-bus-protocol.h
        sd-bus-vtable.h
        sd-daemon.h
        sd-event.h
        sd-id128.h
        sd-login.h
        sd-messages.h
'''.split()
#endif // 0

# https://github.com/mesonbuild/meson/issues/1633
systemd_headers = files(_systemd_headers)

#  sd-device.h
#  sd-hwdb.h
#  sd-dhcp6-client.h
#  sd-dhcp6-lease.h
#  sd-dhcp-client.h
#  sd-dhcp-lease.h
#  sd-dhcp-server.h
#  sd-ipv4acd.h
#  sd-ipv4ll.h
#  sd-lldp.h
#  sd-ndisc.h
#  sd-netlink.h
#  sd-network.h
#  sd-path.h
#  sd-resolve.h
#  sd-utf8.h

install_headers(
        systemd_headers,
        '_sd-common.h',
#if 0 /// elogind needs them somewhere else
#         subdir : 'systemd')
#else
        subdir : 'elogind/systemd')
#endif // 0

meson.add_install_script(meson_symlink_headers,
                         includedir,
                         _systemd_headers)


############################################################

opts = [['c'],
        ['c', '-ansi'],
        ['c', '-std=iso9899:1990']]

cxx = find_program('c++', required : false)
if cxx.found()
        opts += [['c++']]
endif

foreach header : _systemd_headers
        foreach opt : opts
                name = ''.join([header, ':'] + opt)
                test('cc-' + name,
                     check_compilation_sh,
                     args : cc.cmd_array() + ['-c', '-x'] + opt +
                            ['-Werror', '-include',
                             join_paths(meson.current_source_dir(), header)])
        endforeach
endforeach