You can set up dependency relationships between projects using the Project Dependencies dialog. Project dependencies make it possible to build solutions in the correct order and where the target permits, to manage loading and deleting applications and libraries in the correct order. A typically usage of project dependencies is to make an executable project dependent upon a library executable. When you elect to build the executable then the build system will ensure that the library it is dependent upon is up to date. In the case of a dependent library then the output file of the library build is supplied as an input to the executable build so you don’t have to worry about this.

Project dependencies are stored as project properties and as such can be defined differently based upon the selected configuration. You almost always want project dependencies to be independent of the configuration so the Project Dependencies dialog selects the Common configuration by default.

###### Making a project dependent upon another

To make one project dependent upon another, do the following:

- From the Project menu, click Dependencies to display the Project Dependencies dialog.
- From the Project dropdown, select the target project which depends upon other projects.
- In the Depends Upon list box, check the projects that the target project depends upon and uncheck the projects that it does not depend upon.

Some items in the Depends Upon list box may be disabled, which indicates that if the project were checked, a circular dependency would result. Studio prevents you from constructing circular dependencies using the Project Dependencies dialog.

###### Finding the project build order

To display the project build order, do the following:

- From the Project menu, click Build Order to display the Project Dependencies dialog with the Build Order tab selected.
- The projects build in order from top to bottom.

If your target supports loading of multiple projects, then the Build Order also reflects the order in which projects are loaded onto the target. Projects will load, in order, from top to bottom. Generally, libraries need to be loaded before applications that use them, and you can ensure that this happens by making the application dependent upon the library. With this a dependency set, the library gets built before the application and loaded before the application.

Applications are deleted from a target in reverse build order, and as such applications are removed before the libraries that they depend upon.