Create target dependencies

You can add dependencies between your targets so that they build in the correct order.

If your scheme has the Find Implicit Dependencies checkbox enabled, any framework or library listed in a target's Link Binaries With Libraries build phase will implicitly produce a dependency on the target which produces that framework or library, if such a target is present in your project or workspace. Frameworks and libraries linked via the Other Linker Flags build setting do not establish implicit dependencies, so you may need to create explicit target dependencies instead for such targets.

Add a target dependency

  1. In the project editor, choose the target from the Project/Targets pop-up menu, then click Build Phases.

  2. Next to Target Dependencies, click the disclosure triangle icon to reveal the dependencies.

  3. At the bottom of the table, click the Add button (+).

Delete a target dependency

  1. In the project editor, choose the target from the Project/Targets pop-up menu, then click Build Phases.

  2. Next to Target Dependencies, click the disclosure triangle icon to reveal the dependencies.

  3. Select the target to remove, then click the Delete button (–) at the bottom of the table.

Reorder the dependent targets

If you disable parallel builds, the targets are built in the order that you specify.

  1. In the project editor, choose the target from the Project/Targets pop-up menu, then click Build Phases.

  2. Next to Target Dependencies, click the disclosure triangle icon to reveal the dependencies.

  3. To change the order, drag the targets in the table.

See alsoBuild targets in parallel