Next: Define a build environment, Previous: Building all main programs from a single project tree, Up: Aggregate Projects
One other case is when you have multiple applications and libraries that are built independently from each other (but can be built in parallel). For instance, you have a project tree rooted at A, and another one (which might share some subprojects) rooted at B.
Using only gprbuild, you could do
gprbuild -PA.gpr gprbuild -PB.gpr
to build both. But again, gprbuild has to do some duplicate work for those files that are shared between the two, and cannot truly build things in parallel efficiently.
If the two projects are really independent, share no sources other than through a common subproject, and have no source files with a common basename, you could create a project C that imports A and B. But these restrictions are often too strong, and one has to build them independently. An aggregate project does not have these limitations and can aggregate two project trees that have common sources.
This scenario is particularly useful in environments like VxWorks 653 where the applications running in the multiple partitions can be built in parallel through a single gprbuild command. This also works nicely with Annex E.