comp.lang.ada
 help / color / mirror / Atom feed
* gnat project "include file"
@ 2009-12-07 18:27 Zircona
  2009-12-07 19:58 ` sjw
  2009-12-08  8:42 ` Dmitry A. Kazakov
  0 siblings, 2 replies; 3+ messages in thread
From: Zircona @ 2009-12-07 18:27 UTC (permalink / raw)


HI!

I got a projet which are multiple project.. Some of them have
dependency to the other.
Is there a way to change the with command to used an environment
variable?
E.g.
I have a project call electrics.gpr:
with "..\..\..\acsys_common\dist\script\acsys_common.gpr"
project electrics is
end electrics;

I would like something like
with External ("ACSYS_COMMON_SCRIPT") & "/acsys_common.gpr"
project electrics is
end electrics;

Is there a way to do this?

Thanks!



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gnat project "include file"
  2009-12-07 18:27 gnat project "include file" Zircona
@ 2009-12-07 19:58 ` sjw
  2009-12-08  8:42 ` Dmitry A. Kazakov
  1 sibling, 0 replies; 3+ messages in thread
From: sjw @ 2009-12-07 19:58 UTC (permalink / raw)


On Dec 7, 6:27 pm, Zircona <Zircon...@yahoo.com> wrote:

> I got a projet which are multiple project.. Some of them have
> dependency to the other.
> Is there a way to change the with command to used an environment
> variable?
> E.g.
> I have a project call electrics.gpr:
> with "..\..\..\acsys_common\dist\script\acsys_common.gpr"
> project electrics is
> end electrics;
>
> I would like something like
> with External ("ACSYS_COMMON_SCRIPT") & "/acsys_common.gpr"
> project electrics is
> end electrics;

The 'normal' way would be to set the environment variable
ADA_PROJECT_PATH -- you're on a Windows system, so the paths will be
semicolon-separated.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gnat project "include file"
  2009-12-07 18:27 gnat project "include file" Zircona
  2009-12-07 19:58 ` sjw
@ 2009-12-08  8:42 ` Dmitry A. Kazakov
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry A. Kazakov @ 2009-12-08  8:42 UTC (permalink / raw)


On Mon, 7 Dec 2009 10:27:54 -0800 (PST), Zircona wrote:

> I got a projet which are multiple project.. Some of them have
> dependency to the other.
> Is there a way to change the with command to used an environment
> variable?

You do not need to change it. The project itself can depend on the
variable(s), i.e. instead of different versions of the same project X, you
make X dependent on the scenario variables.

E.g.:

project X is

   type Development_Type is ("Debug", "Release");
   Development : Development_Type := external ("Development", "Debug");

   type Platform_Type is ("x86_Windows", "x86_VxWorks");
   Platform : Platform_Type := external ("Platform", "x86_Windows");

   case Platform is
      when "x86_Windows" =>
         for Source_Dirs use Dirs & "os/Windows/i586";
         case Development is
            when "Debug" =>
               for Object_Dir use "lib/x86/Windows/Debug";
            when "Release" =>
               for Object_Dir use "lib/x86/Windows/Release";
         end case;
      when "x86_VxWorks" =>
   ...
etc.

The project Y may simply

with "x.gpr";
project Y is
   ...

Y can share the variables Development and Platform. (Copy type and variable
declaration into Y, when necessary)

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-08  8:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-07 18:27 gnat project "include file" Zircona
2009-12-07 19:58 ` sjw
2009-12-08  8:42 ` Dmitry A. Kazakov

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