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: Sun, 25 Aug 2013 20:22:14 -0500
Date: 2013-08-25T20:22:14-05:00	[thread overview]
Message-ID: <85k3j9fdq1.fsf@stephe-leake.org> (raw)
In-Reply-To: 167c4830-c8f9-48d3-9850-b1772c2aa452@googlegroups.com

gautier_niouzes@hotmail.com writes:

> The title says most, except it is through a GNAT project (.gpr).
>
> More precisely, all compiled files land into the directory specified in
>   for Object_Dir use ...;
> That's OK.
> But the compiler options specified in
>
>   package Compiler is
>     for Default_Switches ("ada") use (...);
>   end Compiler;
>
> are applied only to the sources found in
>   for Source_Dirs use (...);
> and not to sources found in ADA_INCLUDE_PATH.

As expected; the options specified in a project file apply to sources
included in the project file. That way, you can have several project
files, each with a list of sources and options.

ADA_INCLUDE_PATH is a hold-over from pre-project-file times.

> Bug ? Feature ?

Feature.

> Any way to have the compiler options applied to all sources ?

Create a project file for the sources now in ADA_INCLUDE_PATH, and
'with' that project file from your main project file.

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.    

-- 
-- Stephe


  reply	other threads:[~2013-08-26  1:22 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 [this message]
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
replies disabled

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