开发者

Project that builds both framework for OS X and static library for iOS

开发者 https://www.devze.com 2023-01-31 01:05 出处:网络
I am trying to build a library of code that can be built into a .framework for OS X as well as a shared library for iOS. I\'m not sure this is possible, there seems to be some strange behavior on XCod

I am trying to build a library of code that can be built into a .framework for OS X as well as a shared library for iOS. I'm not sure this is possible, there seems to be some strange behavior on XCode 3.2.5's part.

I want one project that holds all my shared code. Keeping the #if and #else definitions out of the equation here, I'd like this code to be able to be built with the 10.6 SDK as well as the iOS 4.2 SDK. I'd like to have 2 separate targets in my project, one building the .framework, and the other building the shared library lib*.a. They would each only get to compile the code that is relevant to them, but this single project would hold all of it.

My first steps seemed ok - created a fresh new project for building .frameworks, then I added a target to build an iOS shared library. As soon as I flip back to the .framework target, I get an error trying to build:

"target specifies product type 'com.apple.product-type.framework', but there's no such product type for the 'iphonesimulator' platform"

I didn't change the "product type" in the framework target (not even sure how), but it now seems to think that it's supposed to build everything for iphonesimulator, and that product doesn't support frameworks (which indeed it doesn't).

Has anyone else gotten this to work? Is this possible with XC开发者_如何学Code 3.2.5? Will this be possible in XCode 4?

0

精彩评论

暂无评论...
验证码 换一张
取 消