comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Question about GNAT project files.
Date: Mon, 27 Feb 2012 05:08:40 -0800 (PST)
Date: 2012-02-27T05:08:40-08:00	[thread overview]
Message-ID: <d9438b7a-5320-42cd-bee7-dd3299be5dff@w19g2000vbe.googlegroups.com> (raw)
In-Reply-To: Cc6dnSeN8twuEdfS4p2dnAA@giganews.com

Peter C. Chapin wrote on comp.lang.ada:
> I have a library described by a project file, say lib.gpr. I also have a
> test program that exercises the library described by a different project
> file tests.gpr. Finally I have a benchmark program that does speed tests
> of the library described by a project file benchmarks.gpr.
>
> This is fine but it's a pain having three separate projects. Typically
> if I change the library I also want to update the tests and benchmarks.
> I'd like to do all that from a single instance of GPS.
[...]
> What is the "right" way to do this?

I would keep the library project file unchanged and create one project
file for both the tests and the benchmark:

with "lib.gpr";
project Main is
   for Source_Dirs use ("tests", "benchmarks");
   for Main use ("test", "benchmark");
end Main;

You load main.gpr in GPS. If a source file of the library has changed,
gnatmake will recursively rebuild the library using the compiler
switches
specified in lib.gpr and will rebuild any source files of the tests or
benchmark that depend on the recompiled units in the library.

Make sure the Object_Dir of your two project files are different.

Make sure that lib.gpr contains "for Externally_Built use "false";"
(this is the default if you don't specify anything).

HTH

--
Ludovic Brenta.



  parent reply	other threads:[~2012-02-27 13:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-26 19:48 Question about GNAT project files Peter C. Chapin
2012-02-26 20:15 ` Dmitry A. Kazakov
2012-02-26 22:18 ` Greg Moncreaff
2012-02-27 13:41   ` Peter C. Chapin
2012-02-28 16:59     ` Yannick Duchêne (Hibou57)
2012-02-28 18:10       ` AdaMagica
2012-02-28 18:14       ` Simon Wright
2012-02-27 13:08 ` Ludovic Brenta [this message]
2012-02-27 13:43   ` Peter C. Chapin
2012-02-27 15:27   ` Simon Wright
2012-02-28  2:02   ` Peter C. Chapin
2012-02-28  6:56     ` Phil Thornley
2012-02-29  0:04       ` Peter C. Chapin
2012-02-29  9:18         ` Phil Thornley
2012-02-29 14:51           ` Peter C. Chapin
2012-02-29 16:49             ` Phil Thornley
2012-02-29 17:17               ` Peter C. Chapin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox