Skip to content

Commit

Permalink
cmake: Fix build against pcsc-lite >= 2.2
Browse files Browse the repository at this point in the history
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: Yubico#404

Signed-off-by: Jakub Jelen <[email protected]>
  • Loading branch information
Jakuje committed Jul 30, 2024
1 parent f17032b commit 6279231
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 6279231

Please sign in to comment.