Skip to content

meson: respect builtin meson default_library option #234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

eli-schwartz
Copy link
Contributor

pcsclite can be built both statically or shared. It has to be built differently to support static usage due to the delegate mechanism. In order to handle this, separate calls are made to static_library() and shared_library(), which sidestep meson's usual handling for selecting the correct requested build variant.

Solve this by looking up the builtin option and choosing whether or not to build each library. This means people intending to only ship the shared library, no longer spend time compiling the static one -- nor have to manually delete it after it is installed by meson install.

Fixes a stray static library appearing on Gentoo (which builds with default_library=shared).

Ref: #216

pcsclite can be built both statically or shared. It has to be built
differently to support static usage due to the delegate mechanism. In
order to handle this, separate calls are made to static_library() and
shared_library(), which sidestep meson's usual handling for selecting
the correct requested build variant.

Solve this by looking up the builtin option and choosing whether or not
to build each library. This means people intending to only ship the
shared library, no longer spend time compiling the static one -- nor
have to manually delete it after it is installed by `meson install`.

Fixes a stray static library appearing on Gentoo (which builds with
default_library=shared).

Ref: LudovicRousseau#216
Signed-off-by: Eli Schwartz <[email protected]>
@LudovicRousseau LudovicRousseau merged commit b62b635 into LudovicRousseau:master May 7, 2025
7 checks passed
@LudovicRousseau
Copy link
Owner

Thanks

@LudovicRousseau
Copy link
Owner

I completed your patch in 3e734d7

@eli-schwartz
Copy link
Contributor Author

Thanks. That's a really good point about the delegate library and I don't know why I didn't think of it in the first place. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants