comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon.j.wright@mac.com>
Subject: Re: Using GNAT project files and libraries
Date: Sat, 08 Mar 2008 17:33:20 +0000
Date: 2008-03-08T17:33:20+00:00	[thread overview]
Message-ID: <m27igd9l3z.fsf@mac.com> (raw)
In-Reply-To: 571db1b9-0d10-4044-8217-81311a35c7f2@e31g2000hse.googlegroups.com

Maciej Sobczak <see.my.homepage@gmail.com> writes:

> I have a library composed of two packages: the root library package,
> which is empty (pure), and one child containing Some_Procedure. Let's
> say the packages are named L and L.Child. The library is compiled and
> resides in the following directories:
>
> src: l.ads, l-child.ads, l-child.adb
> lib: l.ali, l-child.ali, libl.a
>
> There is also a sibling test directory with the following a.adb:
>
> with L.Child;
> procedure A is
> begin
>    L.Child.Some_Procedure;
> end A;
>
> Now I try to figure out how to write A.gpr project file.
> I have the following:
>
> project A is
>
>     for Source_Files use ("a.adb");
>
>     package Compiler is
>         for Default_Switches ("Ada") use ("-I../src");
>     end Compiler;
>
> end A;

You need l.gpr. I think it would live in the parent directory (up one
from src/, lib/ and test/). Assuming you have one, a.gpr (in test/ I
suppose) would say

   with "../l";
   project A is
      for Source_Files use ("a.adb");
   end A;

OK, now for l.gpr ..

   project L is
     for Source_Dirs use ("src");
     for Object_Dir use "lib";
   end L;

Note this is *not* capable of creating the library. A different .gpr
is needed for this (especially if you're going for a static library).



  parent reply	other threads:[~2008-03-08 17:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-07 22:37 Using GNAT project files and libraries Maciej Sobczak
2008-03-08 11:59 ` Tero Koskinen
2008-03-08 17:33 ` Simon Wright [this message]
2008-03-08 20:46   ` Maciej Sobczak
2008-03-08 22:17     ` Simon Wright
2008-03-09 13:15       ` Maciej Sobczak
2008-03-09 19:03         ` Simon Wright
replies disabled

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