From 627923182e9ef082f7351e21b2ace6058af430c8 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Tue, 30 Jul 2024 10:18:02 +0200 Subject: [PATCH] cmake: Fix build against pcsc-lite >= 2.2 The pcsc-lite 2.2.0 switched from autotools to meson and reworked the pkgconfig files. The new pkg config provides CFLAGS that work ok, but the yubihsm-shell ignores them and hopes that all included files are in the default include directory (with the PCSC prefix). Note, the value ${LIBPCSC_CFLAGS} is not in quotes because it is a semicolon separated list which we need to split to separate items here. This solution works with both old and new versions. Fixes: #404 Signed-off-by: Jakub Jelen --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index acbb3926..eeb78fde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,6 +194,7 @@ if(NOT BUILD_ONLY_LIB) if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") pkg_search_module (LIBPCSC REQUIRED libpcsclite) + string (APPEND CMAKE_C_FLAGS ${LIBPCSC_CFLAGS}) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows") set (LIBPCSC_LDFLAGS "winscard.lib") elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")