Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine order of building projects in Xcode 5 workspace (with dependencies between static library projects)

I am working with an Xcode workspace that combines one iOS application projects with several iOS static library projects. I've now added a further library B project that is dependent on one of its siblings A and run into a build error whereby the compiler cannot find one of A's header files when compiling one of B's files.

I assume this has to do with the order in which these projects are built. So I am wondering what determines the order of the different steps. How can I be sure that A's Copy Files build phase (which copies the required header file) executes before B's file are compiled. I can see the apparent order of source files for compilation in the target's Compile Sources build phase; is there a similar list that determines the "order" of projects inside the workspace. The project navigator view imposes one, but swapping A and B in that view does not remedy the problem.

Has any one succeeded with this kind of setup (cross-dependency between static library projects in a workspace, all compiled into a single bundle) and what was the required configuration?

like image 343
Drux Avatar asked Jun 05 '14 10:06

Drux


People also ask

What are dependencies in Xcode?

A dependency is another target that must be built before the current target can be. For example, if you have an app target and a framework target, the app target can have the framework target as a dependency, to ensure that the framework is built first. That is, the app target "depends" on the framework.


1 Answers

In the scheme under 'Build' you can drag the targets used into a specific order. If you un-check the 'Parallelize Build' option the targets are built in the specified order. So the later ones can have dependencies to the earlier ones.

like image 160
JTea Avatar answered Nov 09 '22 05:11

JTea