summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2024-03-30 00:36:51 +0100
committerLuca Boccassi <bluca@debian.org>2024-04-03 12:50:25 +0200
commit8707c9b24465ad2d45c1093a431a0597d8341077 (patch)
treef27da979f05ae1240a73e210120608336777e89f /meson.build
parentresolve: avoid reusing 'r' for encoded packet size (diff)
downloadsystemd-8707c9b24465ad2d45c1093a431a0597d8341077.tar.xz
systemd-8707c9b24465ad2d45c1093a431a0597d8341077.zip
gcrypt: dlopenify for libsystemd
gcrypt is used only for journal sealing operations in libsystemd, so it can be made into a dlopen dependency that is used only on demand. This allows to reduce the footprint of libsystemd in the most common cases. Keep systemd-pull and systemd-resolved with normal linking, as they are executables, and usually built with OpenSSL support anyway.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build9
1 files changed, 5 insertions, 4 deletions
diff --git a/meson.build b/meson.build
index 897b393869..64dde57680 100644
--- a/meson.build
+++ b/meson.build
@@ -1319,6 +1319,9 @@ if not have
# link to neither of the libs if one is not found
libgcrypt = []
libgpg_error = []
+ libgcrypt_cflags = []
+else
+ libgcrypt_cflags = libgcrypt.partial_dependency(includes: true, compile_args: true)
endif
conf.set10('HAVE_GCRYPT', have)
@@ -1951,8 +1954,7 @@ libsystemd = shared_library(
include_directories : libsystemd_includes,
link_args : ['-shared',
'-Wl,--version-script=' + libsystemd_sym_path],
- link_with : [libbasic,
- libbasic_gcrypt],
+ link_with : [libbasic],
link_whole : [libsystemd_static],
dependencies : [librt,
threads,
@@ -1968,7 +1970,6 @@ install_libsystemd_static = static_library(
'systemd',
libsystemd_sources,
basic_sources,
- basic_gcrypt_sources,
fundamental_sources,
include_directories : libsystemd_includes,
build_by_default : static_libsystemd != 'false',
@@ -1979,7 +1980,7 @@ install_libsystemd_static = static_library(
dependencies : [libblkid,
libcap,
libdl,
- libgcrypt,
+ libgcrypt_cflags,
liblz4_cflags,
libmount,
libopenssl,