comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: [GNAT] compiler options ignored for sources from ADA_INCLUDE_PATH
Date: Tue, 27 Aug 2013 07:42:16 -0500
Date: 2013-08-27T07:42:16-05:00	[thread overview]
Message-ID: <857gf7fgpj.fsf@stephe-leake.org> (raw)
In-Reply-To: 88b6ef16-7473-44a8-95fa-1115be6eac2c@googlegroups.com

gautier_niouzes@hotmail.com writes:

> Le lundi 26 août 2013 03:22:14 UTC+2, Stephen Leake a écrit :
>
>> If you want the same options (sounds like you do), create an 'options'
>> project file that just defines some variables, and use those variables
>> in the other project files.    
>
> There is a snag here. "The other project files" can be XMLAda and many others.
> XMLAda only depends on several project files:
> xmlada.gpr
> xmlada_dom.gpr
> xmlada_input.gpr
> xmlada_sax.gpr
> xmlada_schema.gpr
> xmlada_shared.gpr
> xmlada_unicode.gpr
> So I would need to to special versions of dozens of project files
> (xmlada2.gpr, ...) for having a reference to options.gpr ?

Why do you want to change the options in those files?

If you really do need to change them, then yes, you need to create lots
of new project files. 

Or just one, that includes all the sources. It depends on why they
were split up in the first place.

Or edit the existing project files in place; use a .diff so you can
apply the same changes in the future.

> Then have installation instructions for the users of my project
> regarding where to place those special project files ?
> Do changes in xmlada2.gpr etc. each time xmlada.gpr etc. are changing ?
> I seems a bit complicated (to be polite)...

Which is why you should not change options in external packages.

You are trusting the package providers to provide good .ad? files; why
do you not trust the .gpr files?

You could lobby upstream to provide hooks for this, although I'm not
clear what that would look like.

> It's very fine when all projects are yours, but if you use many
> external projects, it is not practical.
> Thanks anyway for the explanations. I think I'll stick to
> ADA_INCLUDE_PATH and a main project and have a script to precompile
> those library items.

So you are using one project file to compile all the sources, ignoring
the provided package files. That may be dangerous; some of the packages
may set options that are important (bug workarounds, for example).

You cannot expect users to ignore the project files in xmlada. On
Debian, for example, they are available pre-compiled. And the GNAT
installer compiles them with the provided project files. 

GNAT and Debian (and probably most distributions) provide a standard
place to put project files, so just "with xmlada;" in your project
works. Why are you not doing that?

If you really insist on doing things wrong, just create one project file
that has Source_Dirs set to the same list as your current ADA_INCLUDE_PATH, and
include that project in your project file.

-- 
-- Stephe


      parent reply	other threads:[~2013-08-27 12:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-25  7:02 [GNAT] compiler options ignored for sources from ADA_INCLUDE_PATH gautier_niouzes
2013-08-26  1:22 ` Stephen Leake
2013-08-26  6:42   ` gautier_niouzes
2013-08-26  7:37     ` Simon Wright
2013-08-26 11:21       ` gautier_niouzes
2013-08-26 19:21         ` briot.emmanuel
2013-08-27 12:42     ` Stephen Leake [this message]
replies disabled

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