Skip to content

Ensure libheif symbols are found when built statically #3715

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
merged 1 commit into from
Oct 17, 2023

Conversation

kleisauke
Copy link
Member

libheif is a C++ library that exposes a C API. When it's built statically, the linker must also link with the C++ stdlib, which is done automatically when using a C++ compiler.

Prior to commit strukturag/libheif@27097a6, libheif included libstdc++ in the Libs.private field of their .pc file. This meant it was exposed in the case of static linking, enabling a build system for a C application to link against libstdc++ as needed. However, this was not portable as libstdc++ is specific to the GNU toolchain, when using Clang, you can optionally use libc++.

This PR aims to find symbols in libheif using a C++ compiler, ensuring that Meson can confirm their availability at link-time, even when libheif is statically built.

libheif is a C++ library that exposes a C API. When it's built
statically, the linker must also link with the C++ stdlib, which
is done automatically when using a C++ compiler.

Prior to commit strukturag/libheif@27097a6, libheif included
libstdc++ in the `Libs.private` field of their .pc file. This meant
it was exposed in the case of static linking, enabling a build
system for a C application to link against libstdc++ as needed.
However, this was not portable as libstdc++ is specific to the GNU
toolchain, when using Clang, you can optionally use libc++.

This commit aims to find symbols in libheif using a C++ compiler,
ensuring that Meson can confirm their availability at link-time,
even when libheif is statically built.
@kleisauke kleisauke merged commit c1e4d03 into libvips:master Oct 17, 2023
@kleisauke kleisauke deleted the libheif-cpp-has-function branch October 17, 2023 08:25
@kleisauke kleisauke restored the libheif-cpp-has-function branch December 18, 2023 17:44
@kleisauke kleisauke deleted the libheif-cpp-has-function branch December 18, 2023 17:44
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