comp.lang.ada
 help / color / mirror / Atom feed
From: sjw <simon.j.wright@mac.com>
Subject: Re: Conditional Compilation in Ada
Date: Mon, 29 Jun 2009 05:15:19 -0700 (PDT)
Date: 2009-06-29T05:15:19-07:00	[thread overview]
Message-ID: <15ce8441-af38-4498-b3ed-c0517ad87dc6@x3g2000yqa.googlegroups.com> (raw)
In-Reply-To: 768c8117-d8af-4a04-b27e-2e74b69c1e8b@y17g2000yqn.googlegroups.com

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.



  parent reply	other threads:[~2009-06-29 12:15 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 [this message]
2009-06-29 18:00     ` Chrono
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