comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Lundin" <b.f.lundin@gmail.com>
Subject: Re: Checking for OS in gnatstudio project file(.gpr)
Date: Thu, 18 Jun 2020 18:44:17 +0200	[thread overview]
Message-ID: <rcg5l1$51s$1@dont-email.me> (raw)
In-Reply-To: <5eeb50d9$0$1208$e4fe514c@news.kpn.nl>

Den 2020-06-18 kl. 13:32, skrev ldries46:
> I em in neede for a possibility to check within a .gpr file which 
> operating system is runnung. Is there a way to do that? So I can use the 
> same project file without changing  the .gpr file when compiling a 
> program on different OS'ses.
As others have replied you can use scenario variables.
And they are passed from commandline.
But gprbuild looks for variables passed in with -X like -XVARIBLE=Value
however if that is not found it will look for that name amomg the 
environent variables

so I create env vars for current os/arch/db in the os
and test on every combination needed
db_libs := ();
case db is
   when Oracle     => db_libs := db_lib1;
   when Postgresql => db_libs := db_lib2;
   when sqlserver  => db_libs := db_lib3;
end case


other_libs := ():
case os_arch is
  when AIX_PPC   => other_libs := lib1;
  when Linux_x64 => other_libs := lib2;
  when Linux_arm => other_libs := lib3;
  when Win_64    => other_libs := lib4;
end case

and so on

the use db_libs and other-libs elsewhere in the gprfile



-- 
Björn

  parent reply	other threads:[~2020-06-18 16:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 11:32 Checking for OS in gnatstudio project file(.gpr) ldries46
2020-06-18 11:41 ` Mark Lorenzen
2020-06-18 12:13 ` Dmitry A. Kazakov
2020-06-18 16:44 ` Björn Lundin [this message]
2020-06-19  8:01 ` ldries46
2020-06-19  9:11   ` ldries46
2020-06-19  9:11   ` Mark Lorenzen
2020-06-19 16:29     ` Simon Wright
2020-06-20  9:02       ` ldries46
2020-06-19 16:43 ` Simon Wright
replies disabled

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