summaryrefslogtreecommitdiffstats
path: root/src/cryptsetup/cryptsetup-tokens/meson.build
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-12-16 11:51:08 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-12-16 11:51:40 +0100
commitc01543fdd53ea452566ed80643c96eae9fec3726 (patch)
tree6060b081f1d05b090218bf2bfee5d3ae9ca93bdf /src/cryptsetup/cryptsetup-tokens/meson.build
parentmeson: drop convenience library that was only used in one place (diff)
downloadsystemd-c01543fdd53ea452566ed80643c96eae9fec3726.tar.xz
systemd-c01543fdd53ea452566ed80643c96eae9fec3726.zip
meson: drop three more single-use convenience libraries
The way that the cryptsetup plugins were built was unnecessarilly complicated. We would build three static libraries that would then be linked into dynamic libraries. No need to do this. While at it, let's use a convenience library to avoid compiling the shared code more than once. We want the output .so files to be located in the main build directory, like with all consumable build artifacts, so we need to maintain the split between src/cryptsetup/cryptsetup-token/meson.build and the main meson.build file. AFAICT, the build artifacts are the same: exported and undefined symbols are identical. There is a tiny difference in size, but I think it might be caused by a different build directory name.
Diffstat (limited to '')
-rw-r--r--src/cryptsetup/cryptsetup-tokens/meson.build82
1 files changed, 23 insertions, 59 deletions
diff --git a/src/cryptsetup/cryptsetup-tokens/meson.build b/src/cryptsetup/cryptsetup-tokens/meson.build
index d174fcb714..42c29f100e 100644
--- a/src/cryptsetup/cryptsetup-tokens/meson.build
+++ b/src/cryptsetup/cryptsetup-tokens/meson.build
@@ -1,64 +1,28 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
-if conf.get('HAVE_LIBCRYPTSETUP_PLUGINS') == 1
-
-cryptsetup_token_c_args = ['-fvisibility=hidden']
-
cryptsetup_token_sym = files('cryptsetup-token.sym')
cryptsetup_token_sym_path = meson.current_source_dir() / 'cryptsetup-token.sym'
-if conf.get('HAVE_TPM2') == 1
- cryptsetup_token_systemd_tpm2_sources = files('''
- cryptsetup-token-systemd-tpm2.c
- cryptsetup-token.h
- cryptsetup-token-util.h
- cryptsetup-token-util.c
- luks2-tpm2.c
- luks2-tpm2.h
- '''.split())
-
- cryptsetup_token_systemd_tpm2_static = static_library(
- 'cryptsetup-token-systemd-tpm2_static',
- cryptsetup_token_systemd_tpm2_sources,
- include_directories : includes,
- dependencies : libshared_deps + [libcryptsetup, versiondep],
- c_args : cryptsetup_token_c_args)
-endif
-
-if conf.get('HAVE_LIBFIDO2') == 1
- cryptsetup_token_systemd_fido2_sources = files('''
- cryptsetup-token-systemd-fido2.c
- cryptsetup-token.h
- cryptsetup-token-util.h
- cryptsetup-token-util.c
- luks2-fido2.c
- luks2-fido2.h
- '''.split())
-
- cryptsetup_token_systemd_fido2_static = static_library(
- 'cryptsetup-token-systemd-fido2_static',
- cryptsetup_token_systemd_fido2_sources,
- include_directories : includes,
- dependencies : libshared_deps + [libcryptsetup, versiondep],
- c_args : cryptsetup_token_c_args)
-endif
-
-if conf.get('HAVE_P11KIT') == 1
- cryptsetup_token_systemd_pkcs11_sources = files('''
- cryptsetup-token-systemd-pkcs11.c
- cryptsetup-token.h
- cryptsetup-token-util.h
- cryptsetup-token-util.c
- luks2-pkcs11.c
- luks2-pkcs11.h
- '''.split())
-
- cryptsetup_token_systemd_pkcs11_static = static_library(
- 'cryptsetup-token-systemd-pkcs11_static',
- cryptsetup_token_systemd_pkcs11_sources,
- include_directories : includes,
- dependencies : libshared_deps + [libcryptsetup, versiondep],
- c_args : cryptsetup_token_c_args)
-endif
-
-endif
+lib_cryptsetup_token_common = static_library(
+ 'cryptsetup-token-common',
+ 'cryptsetup-token.h',
+ 'cryptsetup-token-util.h',
+ 'cryptsetup-token-util.c',
+ include_directories : includes,
+ link_with : libshared,
+ build_by_default : false)
+
+cryptsetup_token_systemd_tpm2_sources = files(
+ 'cryptsetup-token-systemd-tpm2.c',
+ 'luks2-tpm2.c',
+ 'luks2-tpm2.h')
+
+cryptsetup_token_systemd_fido2_sources = files(
+ 'cryptsetup-token-systemd-fido2.c',
+ 'luks2-fido2.c',
+ 'luks2-fido2.h')
+
+cryptsetup_token_systemd_pkcs11_sources = files(
+ 'cryptsetup-token-systemd-pkcs11.c',
+ 'luks2-pkcs11.c',
+ 'luks2-pkcs11.h')