Re: How to read the deployment target of a .plugin?
Re: How to read the deployment target of a .plugin?
- Subject: Re: How to read the deployment target of a .plugin?
- From: Chris Hanson <email@hidden>
- Date: Tue, 12 Feb 2013 11:27:50 -0800
On Feb 10, 2013, at 7:09 PM, Jerry Krinock <email@hidden> wrote:
> In an .app project, the Build Setting named Deployment Target in Xcode gets compiled into the product's Info.plist as LSMinimumSystemVersion, and this is the minimum Mac OS X version in which the product will launch.
That is a convenience; the Deployment Target build setting determines at compile and link time what APIs should be weak-linked. An application’s LSMinimumSystemVersion does not have to be the same as its Deployment Target; for example, the Deployment Target could be 10.7 but the application’s LSMinimumSystemVersion could be 10.7.2, or even 10.8.
> In a .plugin project, there is also a Deployment Target in Xcode, but I don't see this reflected anywhere in the product's Info.plist. How does it work?
>
> Why I want to know this: I think that maybe, thanks to Xcode 4.5, I've built a plugin with Deployment Target set to the mysterious "Compiler Default" which will not load in a system < 10.8. I cannot find any indication of what "Compiler Default" is. Even the "Resolved" column of the "OS X Deployment Target" Build Setting in Xcode tells me only "Compiler Default" :( I suspect that it is 10.8. But it seems like this should be stated in the product somewhere.
First off, don’t leave the Deployment Target set to Compiler Default, set it explicitly to the minimum OS on which your code will run. Always.
There’s no LSMinimumSystemVersion in the Info.plist of a plug-in product by default because NSBundle/CFBundle does not enforce a minimum system version, Launch Services does. Since a plug-in isn’t “launched,” it doesn’t make sense for it to have one. However the Deployment Target setting is still useful for plug-in targets at compile and link time for weak-linking newer APIs. If you’re building an app that uses plug-ins, and you want plug-ins to be able to say they require a minimum OS version, you’ll need to implement that yourself.
Another thing to consider is that the controlling executable for a process — the one that it’s launched with — is the executable that determines the behavior of the APIs the app uses. Specifically, some APIs maintain bug-for-bug compatibility when linked against the libraries/frameworks in an older SDK so existing applications stay binary-compatible. Applications built against a newer SDK, however, get the correct framework behavior. Since this is all determined by the controlling executable, you cannot get new behavior in a plug-in and old behavior in its host app (or vice versa) by building them against different SDKs.
-- Chris
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden