Ensure libheif symbols are found when built statically #3715
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.