From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d831f4147659ab6a X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!peer1.news.newnet.co.uk!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Using GNAT project files and libraries Date: Sat, 08 Mar 2008 17:33:20 +0000 Organization: Pushface Message-ID: References: <571db1b9-0d10-4044-8217-81311a35c7f2@e31g2000hse.googlegroups.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1204997604 21123 62.49.19.209 (8 Mar 2008 17:33:24 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 8 Mar 2008 17:33:24 +0000 (UTC) Cancel-Lock: sha1:6vDw8Bf6Ed+dZniA+S6kyFElObg= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (darwin) Xref: g2news1.google.com comp.lang.ada:20237 Date: 2008-03-08T17:33:20+00:00 List-Id: Maciej Sobczak 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).