From: anon@att.net
Subject: Re: Compiler switches for directory in GNAT project files
Date: Sat, 27 Aug 2011 21:34:32 +0000 (UTC)
Date: 2011-08-27T21:34:32+00:00 [thread overview]
Message-ID: <j3bnt7$q9l$1@speranza.aioe.org> (raw)
In-Reply-To: 6e8c14b6-efab-44b3-b857-252bfd63744d@n12g2000yqh.googlegroups.com
There asre two ways:
You can use the "Case" statement if you use an external/internal
variable
type SRC_Type is ( "default", "easy", "advance" ) ;
--
SRC : SRC_Type := external ( "SRC", "default" ) ;
case SRC is
when "default" =>
for Source_Files use ( "libraries_1.adb",
"print_1.adb",
"environment_1.ads" ) ;
when "easy" =>
for Source_Files use ( "libraries_2.adb",
"print_1.adb",
"environment_2.ads" ) ;
when "advance" =>
for Source_Files use ( "libraries_3.adb",
"print_2.adb",
"environment_1.ads" ) ;
end case;
--
-- or you can use the "for Swiches" statement
--
package Compiler is
for Default_Switches ( "Ada" ) use ( "-gnat95" ) ; -- default 95 specs
--
for Switches ( "Program_1.adb" ) use ( "-gnat05" ) ; -- Ada 2005 specs
for Switches ( "Program_2.adb" ) use ( "-gnat12" ) ; -- using Ada 2012
end Compiler ;
In <6e8c14b6-efab-44b3-b857-252bfd63744d@n12g2000yqh.googlegroups.com>, =?ISO-8859-1?Q?Bj=F6rn?= <ssh9614@hotmail.com> writes:
>I have a number of source files in a GNAT project which have been
>automatically generated. I want to compile these source files with
>different compiler switches from the rest of the project (e.g. less
>warnings).
>
>All of the automatically generated files are located in one single
>folder. Up until now I've specified them one by one in the project
>file: for Switches ("foo.adb") use ... However, the list of specified
>files have now grown well over a hundred.
>
>Is there a way to specify specific compiler switches for all files
>contained in a specific directory in GNAT project files?
>
>/Bj=F6rn
prev parent reply other threads:[~2011-08-27 21:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-27 17:49 Compiler switches for directory in GNAT project files Björn
2011-08-27 19:50 ` Robert A Duff
2011-08-28 7:24 ` Björn
2011-08-27 21:34 ` anon [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