Skip to content

Commit

Permalink
meson: also build static version of libpcsclite
Browse files Browse the repository at this point in the history
We now build both versions of the library: dynamic and static.

In the case of static library it is no more possible to use
LIBPCSCLITE_DELEGATE to redirect to another libpcsclite.

Thanks to areqq for the bug report
" loading "libpcsclite_real.so.1" failed: Dynamic loading not supported #216 "
LudovicRousseau/PCSC#216 (comment)
  • Loading branch information
LudovicRousseau committed Dec 24, 2024
1 parent 55431b5 commit 6eb4d1c
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ libpcsclite_real_src = [
'src/utils.c',
'src/winscard_msg.c'
]
library('pcsclite_real',
shared_library('pcsclite_real',
libpcsclite_real_src,
include_directories : incdir,
dependencies : threads_dep,
Expand All @@ -185,13 +185,25 @@ libpcsclite_src = [
'src/libredirect.c',
'src/sys_unix.c'
]
libpcsclite = library('pcsclite',
libpcsclite = shared_library('pcsclite',
libpcsclite_src,
dependencies : dl_deps,
include_directories : incdir,
soversion : 1,
install : true)

# static library
libpcsclite_static_src = libpcsclite_real_src + [
'src/error.c',
'src/g_defines.c',
]
libpcsclite_static = static_library('pcsclite',
libpcsclite_static_src,
include_directories : incdir,
dependencies : threads_dep,
c_args: '-DLIBPCSCLITE -DSIMCLIST_NO_DUMPRESTORE',
install : true)

# libpcsclite_fake library
library('pcsclite_fake',
sources : 'src/libfake.c',
Expand Down Expand Up @@ -228,6 +240,11 @@ executable('pcsc_demo',
include_directories : incdir,
link_with : libpcsclite)

executable('pcsc_demo_static',
sources : 'doc/example/pcsc_demo.c',
include_directories : incdir,
link_with : libpcsclite_static)

# PC/SC headers
install_headers(
['src/PCSC/debuglog.h',
Expand Down

0 comments on commit 6eb4d1c

Please sign in to comment.