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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a02622021d090376 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!news2.euro.net!azure.qinip.net!xara.net!gxn.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: [GNAT 2006] Project file and conditional withing/linking Date: Thu, 08 Jun 2006 20:50:09 +0100 Organization: Pushface Message-ID: References: <4epgrmF1g33evU1@individual.net> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1149796209 1433 62.49.19.209 (8 Jun 2006 19:50:09 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Thu, 8 Jun 2006 19:50:09 +0000 (UTC) Cancel-Lock: sha1:YY1fdaOOO0HfDlijJ4Sqvd7DixI= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news2.google.com comp.lang.ada:4711 Date: 2006-06-08T20:50:09+01:00 List-Id: "Alex R. Mosteo" writes: > I'm using a project file and, depending on some external variables, > I want to include some library for linking or not. The library is > defined in its own project file. > > The problem is that withing the library project causes its linker > options to be added no matter what I try, and I'd like to remove > these linker options (otherwise the library is always linked). I don't see why you use Linker_Options? I would have thought you could do everything with Default_Switches ("ada"). > Conditionally withing seems out of the question: the "with"s are to be at > the top. I've tried overriding with > > for Gtkada.Linker'Default_Switches ("ada") use (); > for Gtkada.Linker.Linker_Options use (); No, you can define your own switches, not theirs. > I could remove the withing and copy the switches to my project file, > but I'd strongly prefer to keep using the stock installed library > project file. We have defined environment-dependent symbols in non-source Projects and then used the symbols to create the appropriate switches in the user project. Something like package Linker is case Use_Other_Package is when Yes => for Default_Switches ("ada") use ("-foo") & Other_Package.Linker_Switches; when No => for Default_Switches ("ada") use ("-bar"); end case; end Linker;