Skip to content

Add support for Apple-Framework builds #1246

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Treata11
Copy link

Greetings,

I introduced the required properties in CMakeLists.txt to enable cross-compilation for iOS-derived platforms as explained in the CMake documentation.

Binaries of brotlicommon.framework, brotlidec.framework & brotlienc.framework targets will be generated in the build directory with the following commands:

cmake -S. -B build -DBUILD_FRAMEWORK=TRUE -DCMAKE_SYSTEM_NAME=iOS -DBROTLI_BUNDLED_MODE=ON

cmake --build build --target install --config Release

It's also worth noting that I included the BROTLI_PUBLIC_HDRS files for the targets above to ensure they are included in the built framework bundles.

Copy link

google-cla bot commented Jan 18, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@Treata11
Copy link
Author

Addresses issue #1245

@Treata11 Treata11 marked this pull request as ready for review January 18, 2025 22:18
@Treata11
Copy link
Author

@eustas, Changes above are sufficient to build for iOS-derived platforms & their simulators.
Separate framework bundles are generated for each target:
(brotlicommon.framework, brotlidec.framework & brotlienc.framework).

foreach(lib ${BROTLI_LIBRARIES_CORE})
set_target_properties(${lib} PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION "${BROTLI_FULL_VERSION}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you this PR.

Please confirm, that FRAMEWORK_VERSION / MACOSX_FRAMEWORK_BUNDLE_VERSION should be semantic (ABI) version. I.e. as of today it will be 2.0.1, not 1.1.0. If not, use existing BROTLI_VERSION (API version)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review.

Both of the properties are strings that can represent either the ABI or API versions, or even single-letter versioning.
The choice often depends on project conventions or ecosystem requirements

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