summaryrefslogtreecommitdiff
path: root/src/timesync/meson.build
blob: 54f5b18a3aa6145f20ab08ad8f88909418be7a4d (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
# SPDX-License-Identifier: LGPL-2.1-or-later

sources = files(
        'timesyncd-conf.c',
        'timesyncd-manager.c',
        'timesyncd-server.c',
)

systemd_timesyncd_sources = files(
        'timesyncd.c',
        'timesyncd-bus.c',
)

sources += custom_target(
        'timesyncd-gperf.c',
        input : 'timesyncd-gperf.gperf',
        output : 'timesyncd-gperf.c',
        command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])

if get_option('link-timesyncd-shared')
        timesyncd_link_with = [libshared]
else
        timesyncd_link_with = [libsystemd_static,
                               libshared_static,
                               libbasic_gcrypt]
endif

libtimesyncd_core = static_library(
        'timesyncd-core',
        sources,
        include_directories : includes,
        dependencies : userspace,
        link_with : timesyncd_link_with,
        build_by_default : false)

custom_target(
        'timesyncd.conf',
        input : 'timesyncd.conf.in',
        output : 'timesyncd.conf',
        command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
        install : conf.get('ENABLE_TIMESYNCD') == 1 and install_sysconfdir_samples,
        install_dir : pkgsysconfdir)

if conf.get('ENABLE_TIMESYNCD') == 1
        install_data('org.freedesktop.timesync1.conf',
                     install_dir : dbuspolicydir)
        install_data('org.freedesktop.timesync1.service',
                     install_dir : dbussystemservicedir)
        install_data('80-systemd-timesync.list',
                     install_dir : ntpservicelistdir)
        install_data('org.freedesktop.timesync1.policy',
                     install_dir : polkitpolicydir)
endif

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

tests += [
        {
                'sources' : files('test-timesync.c'),
                'link_with' : [
                        libshared,
                        libtimesyncd_core,
                ],
                'dependencies' : libm,
        },
]