comp.lang.ada
 help / color / mirror / Atom feed
From: Chrono <pablittto@gmail.com>
Subject: Re: Conditional Compilation in Ada
Date: Mon, 29 Jun 2009 11:00:06 -0700 (PDT)
Date: 2009-06-29T11:00:06-07:00	[thread overview]
Message-ID: <d6acda9e-09f6-45fe-80c0-07282191ae0c@t13g2000yqt.googlegroups.com> (raw)
In-Reply-To: 15ce8441-af38-4498-b3ed-c0517ad87dc6@x3g2000yqa.googlegroups.com

On 29 jun, 09:15, sjw <simon.j.wri...@mac.com> wrote:
> On Jun 29, 12:42 pm, sjw <simon.j.wri...@mac.com> wrote:
>
> >    type Environment is ("Real", "Simulated");
> >    Env : Environment := external ("ENVIRONMENT");
> >    case Env is
> >       when "Real" => Env_Path = "Real";
> >       when "Simulated" => Env_Path = "Simulated";
> >    end case;
> >    for Source_Dirs use ..... & Env_Path;
>
> > (I haven't tested this particular example ...)
>
> Ahem. A version which works is
>
> project T is
>    type Environment is ("Real", "Simulated");
>    Env : Environment := external ("ENVIRONMENT");
>    Base_Path := (".");
>    Real_Path := ("Real");
>    Sim_Path := ("Simulated");
>    case Env is
>       when "Real" => for Source_Dirs use Base_Path & Real_Path;
>       when "Simulated" => for Source_Dirs use Base_Path & Sim_Path;
>    end case;
> end T;
>
> When GPS sees this, the Scenario view (Tools > Views > Scenario offers
> ENVIRONMENT with the choices Real, Simulated.

Well, creating folders for each scenario is definitely not a better
solution than using a prep script, mainly in a project with high
complexity in its architecture. Even creating new packages for doing
this (or new variables which are going to be compiled with main code),
due to requirements restrictions. But thanks even though for all
responses.



  reply	other threads:[~2009-06-29 18:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-29 11:10 Conditional Compilation in Ada Pablo
2009-06-29 11:42 ` sjw
2009-06-29 12:01   ` Chrono
2009-06-29 12:30     ` Dmitry A. Kazakov
2009-06-29 12:15   ` sjw
2009-06-29 18:00     ` Chrono [this message]
2009-06-29 20:02       ` sjw
2009-06-30 10:41         ` Chrono
2009-06-29 20:13       ` Robert A Duff
2009-06-30 15:39 ` Per Sandberg
2009-06-30 17:03   ` Chrono
2009-06-30 20:09   ` sjw
2009-06-30 20:15   ` sjw
2009-07-01 16:20     ` Per Sandberg
2009-07-01  0:18 ` anon
replies disabled

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