@@ -39,6 +39,9 @@ config MULTIPROCESS_ALLOWED
bool
imply MULTIPROCESS
+config LIBCACARD
+ bool
+
config FUZZ
bool
select SPARSE_MEM
@@ -113,12 +113,14 @@ config USB_SMARTCARD_PASSTHRU
bool
default y
depends on USB
+ depends on LIBCACARD
select USB_SMARTCARD
config USB_SMARTCARD_EMULATED
bool
default y
depends on USB
+ depends on LIBCACARD
select USB_SMARTCARD
config USB_STORAGE_MTP
@@ -48,13 +48,10 @@ softmmu_ss.add(when: ['CONFIG_POSIX', 'CONFIG_USB_STORAGE_MTP'], if_true: files(
# smartcard
softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reader.c'))
-
-if cacard.found()
- usbsmartcard_ss = ss.source_set()
- usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD_EMULATED', if_true: [cacard, files('ccid-card-emulated.c')])
- usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD_PASSTHRU', if_true: [cacard, files('ccid-card-passthru.c')])
- hw_usb_modules += {'smartcard': usbsmartcard_ss}
-endif
+usbsmartcard_ss = ss.source_set()
+usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD_EMULATED', if_true: [cacard, files('ccid-card-emulated.c')])
+usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD_PASSTHRU', if_true: [cacard, files('ccid-card-passthru.c')])
+hw_usb_modules += {'smartcard': usbsmartcard_ss}
# U2F
softmmu_ss.add(when: 'CONFIG_USB_U2F', if_true: files('u2f.c'))
@@ -2493,6 +2493,7 @@ have_ivshmem = config_host_data.get('CONFIG_EVENTFD')
host_kconfig = \
(get_option('fuzzing') ? ['CONFIG_FUZZ=y'] : []) + \
(have_tpm ? ['CONFIG_TPM=y'] : []) + \
+ (cacard.found() ? ['CONFIG_LIBCACARD=y'] : []) + \
(spice.found() ? ['CONFIG_SPICE=y'] : []) + \
(have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \
(opengl.found() ? ['CONFIG_OPENGL=y'] : []) + \
We add a new configuration flag, LIBCACARD, indicating availability of the libcacard code for building. This way, we can eliminate the explicit test for cacard.found() when configuring USB_SMARTCARD_EMULATED/USB_SMARTCARD_PASSTHRU in hw/usb/meson.build. Signed-off-by: Jon Maloy <jmaloy@redhat.com> --- Kconfig.host | 3 +++ hw/usb/Kconfig | 2 ++ hw/usb/meson.build | 11 ++++------- meson.build | 1 + 4 files changed, 10 insertions(+), 7 deletions(-)