Skip to content

Commit

Permalink
spawn/meson.build: move basic sources to libspawn_options.a
Browse files Browse the repository at this point in the history
This helps reduce the dependencies of small helper/test programs.
  • Loading branch information
MaxKellermann committed Nov 12, 2024
1 parent 46a8ab4 commit c945716
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions src/spawn/meson.build
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
spawn_config = configuration_data()
spawn_config.set('HAVE_LIBCAP', cap_dep.found())

spawn_options_sources = [
'CgroupState.cxx',
]

spawn_options_dependencies = [
]

spawn_sources = [
'CgroupKill.cxx',
'CgroupState.cxx',
'ZombieReaper.cxx',
]

Expand Down Expand Up @@ -105,7 +111,7 @@ if get_variable('libcommon_enable_spawn_daemon', false)
# Enable the client implementation for the spawn daemon (package
# "cm4all-spawn").

spawn_sources += [
spawn_options_sources += [
'accessory/Client.cxx',
]
endif
Expand All @@ -122,7 +128,7 @@ if get_variable('libcommon_enable_spawn_options', false)
# Enable the structs ChildOptions and PreparedChildProcess (which in
# turn need an AllocatorPtr implementation).

spawn_sources += [
spawn_options_sources += [
'CgroupOptions.cxx',
'ChildOptions.cxx',
'Mount.cxx',
Expand All @@ -141,7 +147,7 @@ if get_variable('libcommon_enable_spawn_options', false)
'VfsBuilder.cxx',
]

spawn_dependencies += [
spawn_options_dependencies += [
alloc_dep,
adata_dep,
]
Expand All @@ -160,11 +166,33 @@ endif

configure_file(output: 'config.h', configuration: spawn_config)

spawn_options = static_library(
'spawn_options',
spawn_options_sources,
include_directories: inc,
dependencies: [
util_dep,
io_linux_dep,
cap_dep,
fmt_dep,
],
)

spawn_options_dep = declare_dependency(
link_with: spawn_options,
dependencies: spawn_options_dependencies + [
system_dep,
io_dep,
net_dep,
],
)

spawn = static_library(
'spawn',
spawn_sources,
include_directories: inc,
dependencies: spawn_internal_dependencies + [
spawn_options_dep,
util_dep,
io_linux_dep,
cap_dep,
Expand Down

0 comments on commit c945716

Please sign in to comment.