Building Targets in the Correct Order

Ensure that targets are built in the proper order using target dependencies. In a complex project, you may have several targets that need to be built in a specific order to create related products.

To build targets in the correct order
  1. In the project editor, select the target to which you want to add a dependency.

  2. Click Build Phases at the top of the project editor.

  3. Open the Target Dependencies section.

  4. Click the Add button (+) to add a target dependency.

  5. Select a target from the list and click Add.

For example, a project for a client-server software package may contain targets that create a client application, a server application, tools that provide command-line interfaces to the client and server, and a private framework that all the other targets use. For the project to build correctly, the private framework needs to be built before the other targets—that is, the other targets have a dependency on the private framework.

Related Articles