meson: use a convenience library for the sources shared between core/ and the outside
This avoids double compilation. Those files are tiny, so it doesn't save time, but we avoid repeated warnings and errors, and it's generally cleaner to it this way. The number of commands in 'ninja -C build clean && ninja -C build' drops from 1462 to 1455 for me.
This commit is contained in:
parent
bea3d64a73
commit
53f79e125d
28
meson.build
28
meson.build
|
@ -1713,9 +1713,9 @@ executable('systemd-run-generator',
|
|||
|
||||
executable('systemd-fstab-generator',
|
||||
'src/fstab-generator/fstab-generator.c',
|
||||
'src/core/mount-setup.c',
|
||||
include_directories : includes,
|
||||
link_with : [libshared],
|
||||
link_with : [libcore_shared,
|
||||
libshared],
|
||||
install_rpath : rootlibexecdir,
|
||||
install : true,
|
||||
install_dir : systemgeneratordir)
|
||||
|
@ -2353,20 +2353,18 @@ endif
|
|||
|
||||
executable('systemd-remount-fs',
|
||||
'src/remount-fs/remount-fs.c',
|
||||
'src/core/mount-setup.c',
|
||||
'src/core/mount-setup.h',
|
||||
include_directories : includes,
|
||||
link_with : [libshared],
|
||||
link_with : [libcore_shared,
|
||||
libshared],
|
||||
install_rpath : rootlibexecdir,
|
||||
install : true,
|
||||
install_dir : rootlibexecdir)
|
||||
|
||||
executable('systemd-machine-id-setup',
|
||||
'src/machine-id-setup/machine-id-setup-main.c',
|
||||
'src/core/machine-id-setup.c',
|
||||
'src/core/machine-id-setup.h',
|
||||
include_directories : includes,
|
||||
link_with : [libshared],
|
||||
link_with : [libcore_shared,
|
||||
libshared],
|
||||
install_rpath : rootlibexecdir,
|
||||
install : true,
|
||||
install_dir : rootbindir)
|
||||
|
@ -2678,12 +2676,9 @@ public_programs += exe
|
|||
|
||||
executable('systemd-shutdown',
|
||||
systemd_shutdown_sources,
|
||||
'src/core/mount-setup.c',
|
||||
'src/core/mount-setup.h',
|
||||
'src/core/killall.c',
|
||||
'src/core/killall.h',
|
||||
include_directories : includes,
|
||||
link_with : [libshared],
|
||||
link_with : [libcore_shared,
|
||||
libshared],
|
||||
dependencies : [libmount],
|
||||
install_rpath : rootlibexecdir,
|
||||
install : true,
|
||||
|
@ -2724,12 +2719,9 @@ endif
|
|||
|
||||
exe = executable('systemd-nspawn',
|
||||
systemd_nspawn_sources,
|
||||
'src/core/mount-setup.c', # FIXME: use a variable?
|
||||
'src/core/mount-setup.h',
|
||||
'src/core/loopback-setup.c',
|
||||
'src/core/loopback-setup.h',
|
||||
include_directories : includes,
|
||||
link_with : [libnspawn_core,
|
||||
link_with : [libcore_shared,
|
||||
libnspawn_core,
|
||||
libshared],
|
||||
dependencies : [libblkid],
|
||||
install_rpath : rootlibexecdir,
|
||||
|
|
|
@ -1,5 +1,16 @@
|
|||
# SPDX-License-Identifier: LGPL-2.1+
|
||||
|
||||
libcore_shared_sources = '''
|
||||
killall.c
|
||||
killall.h
|
||||
loopback-setup.c
|
||||
loopback-setup.h
|
||||
machine-id-setup.c
|
||||
machine-id-setup.h
|
||||
mount-setup.c
|
||||
mount-setup.h
|
||||
'''.split()
|
||||
|
||||
libcore_la_sources = '''
|
||||
audit-fd.c
|
||||
audit-fd.h
|
||||
|
@ -69,8 +80,6 @@ libcore_la_sources = '''
|
|||
job.h
|
||||
kill.c
|
||||
kill.h
|
||||
killall.c
|
||||
killall.h
|
||||
kmod-setup.c
|
||||
kmod-setup.h
|
||||
load-dropin.c
|
||||
|
@ -79,14 +88,8 @@ libcore_la_sources = '''
|
|||
load-fragment.h
|
||||
locale-setup.c
|
||||
locale-setup.h
|
||||
loopback-setup.c
|
||||
loopback-setup.h
|
||||
machine-id-setup.c
|
||||
machine-id-setup.h
|
||||
manager.c
|
||||
manager.h
|
||||
mount-setup.c
|
||||
mount-setup.h
|
||||
mount.c
|
||||
mount.h
|
||||
namespace.c
|
||||
|
@ -144,12 +147,22 @@ load_fragment_gperf_nulstr_c = custom_target(
|
|||
command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
|
||||
capture : true)
|
||||
|
||||
# A convenience library to share code with other binaries:
|
||||
# systemd-shutdown, systemd-remount-fs, systemd-machine-id-setup, …
|
||||
libcore_shared = static_library(
|
||||
'core-shared',
|
||||
libcore_shared_sources,
|
||||
include_directories : includes,
|
||||
dependencies : [versiondep,
|
||||
libmount])
|
||||
|
||||
libcore = static_library(
|
||||
'core',
|
||||
libcore_la_sources,
|
||||
load_fragment_gperf_c,
|
||||
load_fragment_gperf_nulstr_c,
|
||||
include_directories : includes,
|
||||
link_whole : libcore_shared,
|
||||
dependencies : [versiondep,
|
||||
threads,
|
||||
librt,
|
||||
|
|
|
@ -714,11 +714,10 @@ tests += [
|
|||
'ENABLE_NSS', 'manual'],
|
||||
|
||||
[['src/test/test-umount.c',
|
||||
'src/core/mount-setup.c',
|
||||
'src/core/mount-setup.h',
|
||||
'src/shutdown/umount.c',
|
||||
'src/shutdown/umount.h'],
|
||||
[],
|
||||
[libcore_shared,
|
||||
libshared],
|
||||
[libmount]],
|
||||
|
||||
[['src/test/test-bus-util.c'],
|
||||
|
|
Loading…
Reference in a new issue