diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-06-23 04:21:40 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-07-31 15:17:34 +0200 |
commit | 07e43306b365150a07a5637786a2514ed3f711f4 (patch) | |
tree | 79a9631200ea9cfea98935219ec9436fef7e6484 | |
parent | meson: introduce infra to build executables and shared libraries by using dic... (diff) | |
download | systemd-07e43306b365150a07a5637786a2514ed3f711f4.tar.xz systemd-07e43306b365150a07a5637786a2514ed3f711f4.zip |
meson: move declaration of cryptsetup token modules
-rw-r--r-- | meson.build | 57 | ||||
-rw-r--r-- | src/cryptsetup/cryptsetup-tokens/meson.build | 54 | ||||
-rw-r--r-- | src/cryptsetup/meson.build | 2 |
3 files changed, 53 insertions, 60 deletions
diff --git a/meson.build b/meson.build index 3753d19094..48fda2a225 100644 --- a/meson.build +++ b/meson.build @@ -2215,7 +2215,6 @@ subdir('src/libsystemd') subdir('src/shared') subdir('src/udev') subdir('src/libudev') -subdir('src/cryptsetup/cryptsetup-tokens') libsystemd = shared_library( 'systemd', @@ -2300,62 +2299,6 @@ install_libudev_static = static_library( c_args : static_libudev_pic ? [] : ['-fno-PIC'], pic : static_libudev_pic) -if conf.get('HAVE_LIBCRYPTSETUP_PLUGINS') == 1 - if conf.get('HAVE_TPM2') == 1 - shared_library( - 'cryptsetup-token-systemd-tpm2', - cryptsetup_token_systemd_tpm2_sources, - include_directories : includes, - link_args : ['-shared', - '-Wl,--version-script=' + cryptsetup_token_sym_path], - link_with : [lib_cryptsetup_token_common, - libshared], - dependencies : [libcryptsetup, - tpm2, - userspace], - link_depends : cryptsetup_token_sym, - install_rpath : pkglibdir, - install : true, - install_dir : libcryptsetup_plugins_dir) - endif - - if conf.get('HAVE_LIBFIDO2') == 1 - shared_library( - 'cryptsetup-token-systemd-fido2', - cryptsetup_token_systemd_fido2_sources, - include_directories : includes, - link_args : ['-shared', - '-Wl,--version-script=' + cryptsetup_token_sym_path], - link_with : [lib_cryptsetup_token_common, - libshared], - dependencies : [libcryptsetup, - libfido2, - userspace], - link_depends : cryptsetup_token_sym, - install_rpath : pkglibdir, - install : true, - install_dir : libcryptsetup_plugins_dir) - endif - - if conf.get('HAVE_P11KIT') == 1 - shared_library( - 'cryptsetup-token-systemd-pkcs11', - cryptsetup_token_systemd_pkcs11_sources, - include_directories : includes, - link_args : ['-shared', - '-Wl,--version-script=' + cryptsetup_token_sym_path], - link_with : [lib_cryptsetup_token_common, - libshared], - dependencies : [libcryptsetup, - libp11kit, - userspace], - link_depends : cryptsetup_token_sym, - install_rpath : pkglibdir, - install : true, - install_dir : libcryptsetup_plugins_dir) - endif -endif - ############################################################ executable_template = { diff --git a/src/cryptsetup/cryptsetup-tokens/meson.build b/src/cryptsetup/cryptsetup-tokens/meson.build index e7b7fbab11..120621eaee 100644 --- a/src/cryptsetup/cryptsetup-tokens/meson.build +++ b/src/cryptsetup/cryptsetup-tokens/meson.build @@ -1,8 +1,5 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -cryptsetup_token_sym = files('cryptsetup-token.sym') -cryptsetup_token_sym_path = meson.current_source_dir() / 'cryptsetup-token.sym' - lib_cryptsetup_token_common = static_library( 'cryptsetup-token-common', 'cryptsetup-token-util.c', @@ -25,3 +22,54 @@ cryptsetup_token_systemd_pkcs11_sources = files( 'cryptsetup-token-systemd-pkcs11.c', 'luks2-pkcs11.c', ) + +template = { + 'include_directories' : includes, + 'link_with' : [ + lib_cryptsetup_token_common, + libshared, + ], + 'link_depends' : files('cryptsetup-token.sym'), + 'install_rpath' : pkglibdir, + 'install' : true, + 'install_dir' : libcryptsetup_plugins_dir, +} + +modules += [ + template + { + 'name' : 'cryptsetup-token-systemd-tpm2', + 'conditions' : [ + 'HAVE_LIBCRYPTSETUP_PLUGINS', + 'HAVE_TPM2', + ], + 'sources' : cryptsetup_token_systemd_tpm2_sources, + 'dependencies' : [ + libcryptsetup, + tpm2, + ], + }, + template + { + 'name' : 'cryptsetup-token-systemd-fido2', + 'conditions' : [ + 'HAVE_LIBCRYPTSETUP_PLUGINS', + 'HAVE_LIBFIDO2', + ], + 'sources' : cryptsetup_token_systemd_fido2_sources, + 'dependencies' : [ + libcryptsetup, + libfido2, + ], + }, + template + { + 'name' : 'cryptsetup-token-systemd-pkcs11', + 'conditions' : [ + 'HAVE_LIBCRYPTSETUP_PLUGINS', + 'HAVE_P11KIT', + ], + 'sources' : cryptsetup_token_systemd_pkcs11_sources, + 'dependencies' : [ + libcryptsetup, + libp11kit, + ], + }, +] diff --git a/src/cryptsetup/meson.build b/src/cryptsetup/meson.build index 45c4154c95..2a8e43a33a 100644 --- a/src/cryptsetup/meson.build +++ b/src/cryptsetup/meson.build @@ -1,5 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later +subdir('cryptsetup-tokens') + systemd_cryptsetup_sources = files( 'cryptsetup-keyfile.c', 'cryptsetup.c', |