Copy a static library without linking to it
Copy a static library without linking to it
- Subject: Copy a static library without linking to it
- From: Jerry Krinock <email@hidden>
- Date: Mon, 20 Dec 2010 07:21:39 -0800
I have the following targets in a project:
App
Framework
Static Library
The App is a thin shell which links to the Framework. Only the Framework needs to *link* to the Static Library, but the App needs to *copy* the Static Library into the Contents/MacOS of its product.
To make this happen, I gave the Static Library target membership in both the App and Framework targets. But this causes the Static Library to appear in the Link Binary With Libraries Build Phase of the App. If I uncheck the Target Membership box in Link Binary With Libraries, the Target Membership box in the Copy Files Build Phase gets unchecked also.
So I am forced by Xcode (3.2.5) to link the App to the Static Library even though it is not necessary. It doesn't seem to do any harm; the App never calls upon it. But it bothers me.
Is there any way to "de-link" these build phases, short of using a Shell Script Build Phase to do the copying? (It doesn't bother me *that* much.) I just want to make sure I'm using Xcode as smartly as possible.
Jerry
P.S. This is the same problem I asked about yesterday, Subject: "How make app use static sqlite in its package, instead of dylib", and yes fattening the static library with the needed architectures solved that problem, although I still wonder how that code linked to the dynamic library without it being in the project. Maybe another dependent target in the project (there are quite a few) linked to it.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden