Skip to content

Add support for Apple-Framework builds#1246

Open
Treata11 wants to merge 8 commits intogoogle:masterfrom
Treata11:master
Open

Add support for Apple-Framework builds#1246
Treata11 wants to merge 8 commits intogoogle:masterfrom
Treata11:master

Conversation

@Treata11
Copy link
Copy Markdown

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.

Signed-off-by: Treata11 <treata11@yahoo.com>
@google-cla
Copy link
Copy Markdown

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.

Signed-off-by: Treata11 <treata11@yahoo.com>
@Treata11
Copy link
Copy Markdown
Author

Addresses issue #1245

@Treata11 Treata11 marked this pull request as ready for review January 18, 2025 22:18
Signed-off-by: Treata11 <treata11@yahoo.com>
Signed-off-by: Treata11 <treata11@yahoo.com>
@Treata11
Copy link
Copy Markdown
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).

Comment thread CMakeLists.txt
foreach(lib ${BROTLI_LIBRARIES_CORE})
set_target_properties(${lib} PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION "${BROTLI_FULL_VERSION}"
Copy link
Copy Markdown
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
Copy Markdown
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's stick then to API version, because those are human readable...

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