]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: introduce libtimesyncd_core library
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 4 Jan 2021 11:09:06 +0000 (20:09 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 18 Jan 2021 22:04:19 +0000 (07:04 +0900)
meson.build
src/timesync/meson.build

index c22aa59cad8bcf4050be78b8c6b4805c83838998..82da1a463a19a35720e0f1c418b59a992c5e2867 100644 (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)
index 9096ef1076b5b9c4e95eea3d36d6255e8055247b..30d2a0caee787dded1884061e75def33ad921b6d 100644 (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())
-
-timesyncd_gperf_c = custom_target(
+sources = files(
+        'timesyncd-conf.c',
+        'timesyncd-conf.h',
+        'timesyncd-manager.c',
+        'timesyncd-manager.h',
+        'timesyncd-ntp-message.h',
+        'timesyncd-server.c',
+        'timesyncd-server.h')
+
+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]],
 ]