Skip to content

Commit 440ba3a

Browse files
committed
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 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 <[email protected]>
1 parent f17032b commit 440ba3a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ if(NOT BUILD_ONLY_LIB)
194194

195195
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
196196
pkg_search_module (LIBPCSC REQUIRED libpcsclite)
197+
string (REPLACE ";" " " MY_LIBPCSC_CFLAGS "${LIBPCSC_CFLAGS}")
198+
string (APPEND CMAKE_C_FLAGS " ${MY_LIBPCSC_CFLAGS}")
197199
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
198200
set (LIBPCSC_LDFLAGS "winscard.lib")
199201
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

0 commit comments

Comments
 (0)