meson: introduce libtimesyncd_core library

This commit is contained in:
Yu Watanabe 2021-01-04 20:09:06 +09:00
parent b09f01463a
commit f5a5284ea1
2 changed files with 32 additions and 33 deletions

View File

@ -2610,19 +2610,11 @@ if conf.get('ENABLE_TIMEDATECTL') == 1
endif
if conf.get('ENABLE_TIMESYNCD') == 1
if get_option('link-timesyncd-shared')
timesyncd_link_with = [libshared]
else
timesyncd_link_with = [libsystemd_static,
libshared_static,
libbasic_gcrypt]
endif
executable(
'systemd-timesyncd',
systemd_timesyncd_sources,
include_directories : includes,
link_with : [timesyncd_link_with],
link_with : [libtimesyncd_core],
dependencies : [threads,
libm],
install_rpath : rootlibexecdir,
@ -2633,7 +2625,7 @@ if conf.get('ENABLE_TIMESYNCD') == 1
'systemd-time-wait-sync',
'src/timesync/wait-sync.c',
include_directories : includes,
link_with : [timesyncd_link_with],
link_with : [libtimesyncd_core],
install_rpath : rootlibexecdir,
install : true,
install_dir : rootlibexecdir)

View File

@ -1,25 +1,38 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
systemd_timesyncd_sources = files('''
timesyncd.c
timesyncd-bus.c
timesyncd-bus.h
timesyncd-conf.c
timesyncd-conf.h
timesyncd-manager.c
timesyncd-manager.h
timesyncd-ntp-message.h
timesyncd-server.c
timesyncd-server.h
'''.split())
sources = files(
'timesyncd-conf.c',
'timesyncd-conf.h',
'timesyncd-manager.c',
'timesyncd-manager.h',
'timesyncd-ntp-message.h',
'timesyncd-server.c',
'timesyncd-server.h')
timesyncd_gperf_c = custom_target(
systemd_timesyncd_sources = files(
'timesyncd.c',
'timesyncd-bus.c',
'timesyncd-bus.h')
sources += custom_target(
'timesyncd-gperf.c',
input : 'timesyncd-gperf.gperf',
output : 'timesyncd-gperf.c',
command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
systemd_timesyncd_sources += [timesyncd_gperf_c]
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,
link_with : [timesyncd_link_with])
if conf.get('ENABLE_TIMESYNCD') == 1
timesyncd_conf = configure_file(
@ -41,14 +54,8 @@ endif
############################################################
tests += [
[['src/timesync/test-timesync.c',
'src/timesync/timesyncd-manager.c',
'src/timesync/timesyncd-manager.h',
'src/timesync/timesyncd-conf.c',
'src/timesync/timesyncd-conf.h',
'src/timesync/timesyncd-server.c',
'src/timesync/timesyncd-server.h',
timesyncd_gperf_c],
[],
[['src/timesync/test-timesync.c'],
[libtimesyncd_core,
libshared],
[libm]],
]