문제

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