Skip to content
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

Support universal libraries on macOS #11

Merged
merged 26 commits into from
Aug 16, 2024
Merged

Support universal libraries on macOS #11

merged 26 commits into from
Aug 16, 2024

Conversation

csparker247
Copy link
Member

@csparker247 csparker247 commented Aug 8, 2024

Adds CMake flag BUILD_MACOS_MULTIARCH, which compiles all dependencies as "universal libraries" (single file containing symbols for x86_64 and arm64).

Enabling this feature additionally requires building libpng from source rather than using the built-in version from OpenCV, so this also adds the flag VCDEPS_BUILD_PNG. To maintain expected behavior, this is off by default, enabled when BUILD_MACOS_MULTIARCH=ON, and can of course be controlled by setting the flag manually.

@csparker247
Copy link
Member Author

csparker247 commented Aug 8, 2024

Currently fails to build on macos because of libpng build issues.

Possible reference: pnggroup/libpng#372

@csparker247 csparker247 force-pushed the multiarch branch 2 times, most recently from 33e5375 to c8357e3 Compare August 9, 2024 13:50
@csparker247
Copy link
Member Author

csparker247 commented Aug 13, 2024

I seem to have it working now. macOS multiarch appears to require an Apple Silicon host to build everything correctly, at least on the GitHub runners.

Waiting to see if my libpng patch gets merged.

@csparker247 csparker247 changed the title Multiarch Support universal libraries on macOS Aug 14, 2024
@csparker247
Copy link
Member Author

The ability to use the official libpng source for this feature is currently waiting on two upstream PRs. In the meantime, we're going to merge this using a patched fork for the libpng reference. Issue #12 will track the status of those two PRs.

@csparker247 csparker247 merged commit 478979b into develop Aug 16, 2024
@csparker247 csparker247 deleted the multiarch branch August 16, 2024 12:58
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