質問

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.

役に立ちましたか?

解決

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");

他のヒント

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top