2

I want to build a C++ library for Mac and iOS using the same Xcode project. When I'm creating a new project in Xcode I can choose Mac OS C++ library, but there is no similar option for iOS. The code is exactly the same on both platforms and I don't see any point having 2 different projects.

Can you provide me some guidance to achieve this?

EDIT: Now I'm using same project with different targets, one for Mac and one for iOS

1 Answer 1

0

Depending on what you want to use this library for, creating an iOS fake framework may also be an option: https://github.com/kstenerud/iOS-Universal-Framework/tree/master

I usually create both (libraries and (fake) frameworks) for a) binary-delivery only SDK projects or b) very fat libraries which are rarely changed but often used. An example for the latter is SQLite, which takes very long to compile for iOS and is maybe changed once a year. But for debugging purpose, I use the same project and code base using a static library target (for when we update the fake framework once in a while and need to debug it).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.