Next: , Previous: Cyclic Project Dependencies, Up: Organizing Projects into Subsystems


11.3.3 Sharing Between Projects

When building an application, it is common to have similar needs in several of the projects corresponding to the subsystems under construction. For instance, they will all have the same compilation switches.

As seen before (see Tools Options in Project Files), setting compilation switches for all sources of a subsystem is simple: it is just a matter of adding a Compiler.Default_Switches attribute to each project files with the same value. Of course, that means duplication of data, and both places need to be changed in order to recompile the whole application with different switches. It can become a real problem if there are many subsystems and thus many project files to edit.

There are two main approaches to avoiding this duplication: