Skip to content

Fix gain-map detection with system libheif - #490

Closed
gregbenz wants to merge 2 commits into
google:mainfrom
gregbenz:codex/fix-libheif-feature-detection
Closed

gregbenz wants to merge 2 commits into
google:mainfrom
gregbenz:codex/fix-libheif-feature-detection

Conversation

@gregbenz

Copy link
Copy Markdown
Contributor

With UHDR_BUILD_DEPS=OFF, the gain-map check can fail even when the installed libheif supports it. If libheif exports multiple compile definitions, only the first gets a -D prefix. The compiler treats the remaining definitions as input files, so configuration completes with HEIF/AVIF support disabled.

This change adds -D to each definition and keeps the existing compile-only check. The regression tests cover absent, empty, single and multiple definitions, plus a header without the gain-map API.

The regression fails before the fix and passes afterward on macOS and Linux. A Linux build with an installed patched libheif also detects support without overriding the check and passes an AVIF encode/decode smoke test. Fork CI passed on Windows (MSVC), Linux, macOS and Android, including all five new regression cases on Windows.

@gregbenz

Copy link
Copy Markdown
Contributor Author

This issue was also fixed in #462, which has now merged. I verified that all five regression cases from this PR pass against current main. Closing this as superseded. Thanks!

@gregbenz gregbenz closed this Sep 29, 2026
@gregbenz
gregbenz deleted the codex/fix-libheif-feature-detection branch September 29, 2026 00:37
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.

1 participant