Frage

Lets say you have a client and a server project where these have some packages in common. Is it possible to produce two exec files (client, server) from a single Ada project?

Using Ada 2012 with Gnat.

War es hilfreich?

Lösung

Yes. You can see an example of how to do it in the project files in my LEGO Tools repository. The critical part is to list the relevant compilation units in a "Main" clause in the project file like this:

for Main use ("build_mpd_file",
              "fractal_landscape",
              "outline_boundaries",
              "pgm_to_ldraw",
              "split_ldraw_file");

Andere Tipps

Yes.
There's nothing special about a subprogram that is to be the main portion of the executable. (There are some restrictions though; IIRC it has to be a paramaterless subprogram, and if a function has to return Integer.)

For GNAT, all that's needed is for you to specify which compilation-units are main files.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top