Skip to content

Fix macOS x86_64 cross-builds with bundled dependencies#402

Open
gregbenz wants to merge 1 commit into
google:mainfrom
gregbenz:fix/macos-x86_64-cross-compile
Open

Fix macOS x86_64 cross-builds with bundled dependencies#402
gregbenz wants to merge 1 commit into
google:mainfrom
gregbenz:fix/macos-x86_64-cross-compile

Conversation

@gregbenz

Copy link
Copy Markdown

Summary

  • Propagate the standard macOS target settings to bundled CMake dependency builds.
  • Add native Intel and Apple-Silicon-to-x86_64 macOS CI coverage, including artifact architecture checks and a native Intel CLI smoke test.
  • Document thin x86_64 cross-compilation on Apple Silicon.

Motivation

CMAKE_OSX_ARCHITECTURES correctly targets libuhdr itself but was not forwarded to bundled dependencies. As a result, an Apple Silicon x86_64 cross-build using UHDR_BUILD_DEPS=1 could build host-architecture dependencies and fail at link time. Forwarding the existing macOS architecture, deployment-target, and sysroot settings keeps every target in the build on the requested architecture.

Validation

  • Native arm64 Release build and CTest: 100% passed.
  • Apple Silicon x86_64 cross-build with bundled dependencies and CTest under Rosetta: 100% passed.
  • lipo confirmed the expected thin architecture for the library, CLI, tests, shared library, and bundled JPEG archive.
  • The arm64 and x86_64 builds exported the same 43 public uhdr symbols.
  • CLI encode, metadata probe, and decode passed on x86_64; arm64 successfully decoded the x86_64-produced JPEG and its decoded raw output was byte-identical.

Scope

  • No new libraries or GitHub Actions are introduced.
  • Universal arm64+x86_64 binaries remain out of scope; this supports one requested architecture per build.

Related: #383

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