-
Notifications
You must be signed in to change notification settings - Fork 12
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
move LLMR from dependent target to statically linked library #9
Comments
The actual move here is going to happen pretty late in the game since introducing the static library early is a workflow pain for LLMR development. |
FWIF, I wouldn't remove/hide C++ files as that'll make it harder to debug for iOS developers if they choose to dive into the lib. |
What I mean by this is how it's done for Proj4 here: https://github.com/mapbox/mapbox-ios-sdk/tree/release/Proj4 Note that all the files, as well as the Xcode project needed to build them, are in the source tree. However, the SDK Xcode project itself merely links in the We could always provide an Xcode workspace (a way of combining 2+ Xcode projects) that includes the normal toolset project as well as the project used to build the static libs of LLMR for people who want to hack it. I think we can consider them largely exclusive audiences a lot of the time, though. |
Taking a crack at this now. |
Happening in https://github.com/mapbox/MVKMapKit/tree/easy-install. Just need to test inclusion in a fresh Xcode project, then will merge. |
Yeah, hitting some walls here. Would appreciate an eyeball, @springmeyer. Here's my current build process, ideally, encapsulated in
My problem however is that MVKMapKit can't build as it relies on
My problem is that MVKMapKit relies on linking against llmr-ios, really. I tried also making Am I screwed here? Should I just be putting MVKMapKit into LLMR proper? My thinking here was to contain the Cocoa code as well as meet the easy clone/install vision described by the screenshot above. Any ideas? |
Can you share the exact command that failed? I'll take a closer look when I can get back online.
|
Replicated this. Its happening because we want to dynamically link zlib but -lz is ending up in the linker args for Thinking through a fix now. |
Having the final app link is ok, btw. Just needs put in the install instructions but it's not a hurdle. |
Other potential gocha / way this is different than libProj4.a is that libMapboxGL.a / libMVKMapKit.a also depends on C++ and libuv.a and libpng.a
|
I was hoping to avoid the need to build for C++, which (I think) may be unavoidable? Basically, does that mean a user has to make their project an Objective-C++ project? Or can this be per-file? |
We should be able to pretend C++ is not involved at compile (so .m rather than .mm files can be used I think). But at link time C++ will need to be involved. Because we need to link a static lib (libMapboxGL.a) the dynamic symbols that static lib depends on also need to be linked at the same time. So, In summary:
Yes, unavoidable.
I don't think so. |
Ok, that's helpful. Linker flags in the install docs are also OK™. |
Okay, progress:
Now I'm hitting this at runtime:
|
Cool, that's a bundle-related issue, but we're out of the woods on linking, so that's what I really needed.
Can you elaborate on:
|
regarding making one .m objective c++:
|
It should be possible to avoid this by instead adding |
Oh, interesting. That's weird. So basically because we aren't compiling in |
yeah, and I see no way to gently tell xcode to link as a C++ app. silly, but at least the workaround is easy, if odd. |
Back on this and close. |
@springmeyer I could possibly use a hand again on a new and wonderfully different task now. So linking is good and I'm trying to solve the resource bundle issue. What needs to happen is that I need the output of the The |
What about just:
|
I did see the file there, but thought that brittle. Works great, though! 👍 |
Ok, as of de9e0d0 we have a shippable static library, resource bundle, and header collection. The last thing I'd like to hit is the wonky Objective-C++ file designation above in #9 (comment), do some quick QA, and tag it. |
First time I've seen an explicit mention of the http://answers.oreilly.com/topic/631-how-to-get-c-and-objective-c-to-play-nicely-in-xcode/ That's looking to be the way. I may just include a dummy as you suggested @springmeyer -- like maybe a |
This is done and the entire download-to-live-view install process is encapsulated here: https://github.com/mapbox/mapbox-gl-cocoa#installation It's very simple and builds in no time to get up & running with Cocoa - easily a few seconds. |
\o/ |
one other idea on the triggering c++ issue. It would also likely work to provide an xconfig file with |
Interesting. I may explore that if there's feedback on the stub file. But right now it fits nicely alongside the other resources: https://github.com/mapbox/mapbox-gl-cocoa/tree/master/dist Thanks a ton for the help & research @springmeyer. |
Steps:
lipo
to combine them into a single filelibLLMR.a
into this project directlyThe text was updated successfully, but these errors were encountered: