Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I know this post is old now, but I'm working on another project and have just had the displeasure of setting up another cross-project reference for an embedded framework that must be built from a separate project before building this project.</p> <p>I came up with a much more elegant fix (and probably the "correct" fix) this time, basically because what I did last time wasn't working (Xcode kept complaining that it couldn't find the framework's main header file).</p> <p>The solution. I've just tested it on a number of projects from scratch just to be sure...</p> <ol> <li>Add the other (dependency) project to your main project by doing "Project -> Add to project"</li> <li>Double click on your target that requires products from the other project.</li> <li>In the general tab, add the required products as direct dependencies (top panel). Close this settings panel.</li> <li>Drag the product from the cross-project reference into the Link Binary with Libraries build phase of your target.</li> <li>Add a new "Copy Files" build phase, selecting "Products" as the destination directory (!!!). Rename this build phase to "Copy Cross-Project Products".</li> <li>Drag your cross-project product(s) into this new build phase and make sure that it's the first build phase in your target.</li> <li>Add one final "Copy Files" build phase to your target, selecting "Frameworks" as the destination.</li> <li>Drag your cross-project product(s) into this new build phase.</li> </ol> <p>While it looks long-winded, most of it is pretty normal and exactly what you'd do if the dependency target was in the same project. The crucial first build phase however needs to copy the built products from the other project into the current project's build directory.</p> <p>Obviously Xcode is smart enough to get the other project to perform the build, but not smart enough to think to look there when it starts compiling your sources that depend on it.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload