Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

dynamically-linked builds for iOS #828

Closed
incanus opened this issue Feb 10, 2015 · 13 comments · Fixed by #3183
Closed

dynamically-linked builds for iOS #828

incanus opened this issue Feb 10, 2015 · 13 comments · Fixed by #3183
Assignees
Labels
build iOS Mapbox Maps SDK for iOS
Milestone

Comments

@incanus
Copy link
Contributor

incanus commented Feb 10, 2015

Carryover from #824. We build statically, but we want a MapboxGL.framework again.

  • Ease of installation
  • Swift support
  • CocoaPods simplification
@incanus incanus added iOS Mapbox Maps SDK for iOS build labels Feb 10, 2015
@incanus incanus self-assigned this Feb 10, 2015
@incanus
Copy link
Contributor Author

incanus commented Feb 10, 2015

@incanus incanus modified the milestone: iOS Beta Feb 13, 2015
@incanus
Copy link
Contributor Author

incanus commented Mar 13, 2015

Moving to b2... static is ok for b1, including for #829 CocoaPods.

@1ec5
Copy link
Contributor

1ec5 commented Apr 2, 2015

We already have Swift support because CocoaPods repackages the static library inside a framework.

@incanus
Copy link
Contributor Author

incanus commented Apr 2, 2015

Good clarification.

@incanus
Copy link
Contributor Author

incanus commented Jun 25, 2015

@1ec5 is gonna take a peek at this for b3, mostly for Carthage #1623.

@incanus incanus assigned 1ec5 and unassigned incanus Jun 25, 2015
@incanus incanus added this to the iOS Beta 3 milestone Jun 25, 2015
@incanus
Copy link
Contributor Author

incanus commented Jul 7, 2015

Let's punt on this until another release.

@incanus incanus removed this from the iOS Beta 3 milestone Jul 7, 2015
@mikemorris
Copy link
Contributor

After setting -fvsibility=hidden all over in #2584, enabling dynamically-linked builds may require prefacing more methods with MBGL_PUBLIC to explicitly expose the public API in a shared library.

UPDATE: Looks like we can get away with -fvisibility-inlines-hidden for now.

@brennanMKE
Copy link

@incanus I have time this week and I'd like to move this forward. Could you task me with specific steps which would get this repo closer to making the build work for bitcode and Carthage? I've learned a lot in the past few weeks and studied the Mapbox build system and could start chipping away at what needs to be done to get it working.

@incanus
Copy link
Contributor Author

incanus commented Nov 7, 2015

Thanks for the offer of help @brennanMKE. I think part of the problem is we don't know the steps, or at least I don't. It probably involves the prebuilt dependencies that we pull down with Mason as well, and maybe building them in a special way.

As much as you could put into this would be appreciated. @1ec5 might have some guidelines as he looked into it in the past.

@mikemorris
Copy link
Contributor

The primary change to any upstream Mason modules would likely be setting -fvisibility=hidden and explicitly exposing a public API symbols with __attribute__((visibility ("default"))), but I don't think this will be immediately necessary to resolve any linker issues now that I've taken care of it for GeoJSONVT.

@1ec5 1ec5 added this to the ios-v3.1.0 milestone Dec 2, 2015
@1ec5
Copy link
Contributor

1ec5 commented Dec 2, 2015

I got this working for the OS X SDK in #3135. It now looks pretty straightforward to move the iOS SDK over to a proper framework too.

@mikemorris
Copy link
Contributor

@1ec5 want to check if the resulting framework gets any smaller when rebasing onto 898-visibility-hidden?

@1ec5
Copy link
Contributor

1ec5 commented Dec 2, 2015

Will do. For now, I’ve tested setting GCC_OPTIMIZATION_LEVEL=-Os (per the value in Xcode’s framework template), and that has taken the OS X framework size down to 5 MB in Release, compared to 35 MB with -O3. So I expect the iOS framework to be smaller than the 290 MB of the static library + headers + resource bundle regardless of the visibility settings.

1ec5 added a commit that referenced this issue Dec 4, 2015
make iproj now produces a target that pulls together static libraries like core and platform-ios into a real dynamic framework. iosapp is pretty much just a regular iOS application that links Mapbox.framework (except for the inclusion of default_styles.hpp). iosapp runs fine in the Simulator and on a device, and the same is true for any application linking against Mapbox.framework. However, make ipackage is busted because of code signing issues.

Working towards #828.
1ec5 added a commit that referenced this issue Dec 12, 2015
make iproj now produces a target that pulls together static libraries like core and platform-ios into a real dynamic framework. iosapp is pretty much just a regular iOS application that links Mapbox.framework (except for the inclusion of default_styles.hpp). iosapp runs fine in the Simulator and on a device, and the same is true for any application linking against Mapbox.framework. However, make ipackage is busted because of code signing issues.

The ipackage target disables code signing, since that happens on copy when the framework is embedded inside the application bundle. It also merges the device and simulator builds into a single fat framework.

Also bumped itest minimum deployment target to iOS 8.0, the first version that supports linking frameworks.

Fixes #828.
1ec5 added a commit that referenced this issue Dec 14, 2015
make iproj now produces a target that pulls together static libraries like core and platform-ios into a real dynamic framework. iosapp is pretty much just a regular iOS application that links Mapbox.framework (except for the inclusion of default_styles.hpp). iosapp runs fine in the Simulator and on a device, and the same is true for any application linking against Mapbox.framework.

The ipackage target produces both a Bitcode-disabled static framework and a Bitcode-enabled dynamic framework, eliminating the need for a separate framework.sh. It disables code signing, since that happens on copy when the framework is embedded inside the application bundle. It also merges the device and simulator builds into a single fat framework.

Also bumped itest minimum deployment target to iOS 8.0, the first version that supports linking frameworks.

Fixes #828.
1ec5 added a commit that referenced this issue Dec 21, 2015
make iproj now produces a target that pulls together static libraries like core and platform-ios into a real dynamic framework. iosapp is pretty much just a regular iOS application that links Mapbox.framework (except for the inclusion of default_styles.hpp). iosapp runs fine in the Simulator and on a device, and the same is true for any application linking against Mapbox.framework.

The ipackage target produces both a Bitcode-disabled static framework and a Bitcode-enabled dynamic framework, eliminating the need for a separate framework.sh. It disables code signing, since that happens on copy when the framework is embedded inside the application bundle. It also merges the device and simulator builds into a single fat framework.

Also bumped itest minimum deployment target to iOS 8.0, the first version that supports linking frameworks.

Fixes #828.
1ec5 added a commit that referenced this issue Dec 23, 2015
make iproj now produces a target that pulls together static libraries like core and platform-ios into a real dynamic framework. iosapp is pretty much just a regular iOS application that links Mapbox.framework (except for the inclusion of default_styles.hpp). iosapp runs fine in the Simulator and on a device, and the same is true for any application linking against Mapbox.framework.

The ipackage target produces both a Bitcode-disabled static framework and a Bitcode-enabled dynamic framework, eliminating the need for a separate framework.sh. It disables code signing, since that happens on copy when the framework is embedded inside the application bundle. It also merges the device and simulator builds into a single fat framework.

Also bumped itest minimum deployment target to iOS 8.0, the first version that supports linking frameworks.

Fixes #828.
1ec5 added a commit that referenced this issue Jan 6, 2016
make iproj now produces a target that pulls together static libraries like core and platform-ios into a real dynamic framework. iosapp is pretty much just a regular iOS application that links Mapbox.framework (except for the inclusion of default_styles.hpp). iosapp runs fine in the Simulator and on a device, and the same is true for any application linking against Mapbox.framework.

The ipackage target produces both a Bitcode-disabled static framework and a Bitcode-enabled dynamic framework, eliminating the need for a separate framework.sh. It disables code signing, since that happens on copy when the framework is embedded inside the application bundle. It also merges the device and simulator builds into a single fat framework.

Also bumped itest minimum deployment target to iOS 8.0, the first version that supports linking frameworks.

Fixes #828.
1ec5 added a commit that referenced this issue Jan 20, 2016
make iproj now produces a target that pulls together static libraries like core and platform-ios into a real dynamic framework. iosapp is pretty much just a regular iOS application that links Mapbox.framework (except for the inclusion of default_styles.hpp). iosapp runs fine in the Simulator and on a device, and the same is true for any application linking against Mapbox.framework.

The ipackage target produces both a Bitcode-disabled static framework and a Bitcode-enabled dynamic framework, eliminating the need for a separate framework.sh. It disables code signing, since that happens on copy when the framework is embedded inside the application bundle. It also merges the device and simulator builds into a single fat framework.

Also bumped itest minimum deployment target to iOS 8.0, the first version that supports linking frameworks.

Fixes #828.
1ec5 added a commit that referenced this issue Jan 22, 2016
make iproj now produces a target that pulls together static libraries like core and platform-ios into a real dynamic framework. iosapp is pretty much just a regular iOS application that links Mapbox.framework (except for the inclusion of default_styles.hpp). iosapp runs fine in the Simulator and on a device, and the same is true for any application linking against Mapbox.framework.

The ipackage target produces both a Bitcode-disabled static framework and a Bitcode-enabled dynamic framework, eliminating the need for a separate framework.sh. It disables code signing, since that happens on copy when the framework is embedded inside the application bundle. It also merges the device and simulator builds into a single fat framework.

Also bumped itest minimum deployment target to iOS 8.0, the first version that supports linking frameworks.

Fixes #828.
1ec5 added a commit that referenced this issue Jan 22, 2016
make iproj now produces a target that pulls together static libraries like core and platform-ios into a real dynamic framework. iosapp is pretty much just a regular iOS application that links Mapbox.framework (except for the inclusion of default_styles.hpp). iosapp runs fine in the Simulator and on a device, and the same is true for any application linking against Mapbox.framework.

The ipackage target produces both a Bitcode-disabled static framework and a Bitcode-enabled dynamic framework, eliminating the need for a separate framework.sh. It disables code signing, since that happens on copy when the framework is embedded inside the application bundle. It also merges the device and simulator builds into a single fat framework.

Also bumped itest minimum deployment target to iOS 8.0, the first version that supports linking frameworks.

Fixes #828.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants