Re: Library Location
Re: Library Location
- Subject: Re: Library Location
- From: Richard Charles <email@hidden>
- Date: Mon, 13 Mar 2017 09:37:38 -0600
> On Mar 10, 2017, at 12:21 PM, Quincey Morris <email@hidden> wrote:
>
> The best solution is to add the library *project* to your app project, not the library *product*. When you tell your app target to link against the library target (e.g. in the project’s Info page), make sure that you specify the library location “Relative to Build Products”, since that’s the only file referencing method that takes the build configuration (Debug or Release) into account.
The statement "Relative to Build Products is the only file referencing method that takes the build configuration into account” turned on a light bulb for me.
By default, Xcode stores derived data for all projects in ~/Library/Developer/Xcode/DerivedData. This means that build products for all configurations are in the same directory (Debug or Release).
If you add the *product* of a custom embedded library to a project, the default location in the file inspector for the library will be “Relative to Group”. Simply change this to “Relative to Build Products” and voila! Build configurations now work as expected for the project, just remember to build the desired library configurations beforehand.
The only thing that doesn’t work is archiving. Because archiving has a different build directory structure you will get a library linker error "No such file or directory”. The fix is simple. When you are ready to archive the project do the following.
1. Edit the Run scheme and change the Build Configuration from Debug to Release.
2. Select the library *product* in the File Inspector and change the Location from "Relative to Build Products" to "Relative to Group".
3. The archive will now build without error.
4. Manually copy the library dSYM file into the archive package.
5. Discard all project changes when you are finished.
--Richard Charles
_______________________________________________
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