comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Checking for OS in gnatstudio project file(.gpr)
Date: Thu, 18 Jun 2020 14:13:26 +0200	[thread overview]
Message-ID: <rcflp4$17r1$1@gioia.aioe.org> (raw)
In-Reply-To: 5eeb50d9$0$1208$e4fe514c@news.kpn.nl

On 18/06/2020 13:32, ldries46 wrote:
> 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.

Well, it is a sad story.

Actually there is Project'Target which should give you Linux-esque 
triplet containing architecture and OS. [Isn't it obvious that you need 
three fields for two things?]

Unfortunately it does not work. Sometimes (most of the times?) it is empty.

And even if it worked GRP has no means to split a triplet into parts 
because it has no string indexing. So you will end up with a long case like:

    Target_Triplet := Project'Target;

    case Target_Triplet is
       when "aarch64-linux-gnu" =>
       when "arm-linux" =>
       when "arm-linux-gnueabi" =>
       when "arm-linux-gnueabihf" =>
       when "x86_64-apple-darwin" =>
       when "x86_64-freebsd" =>

and so on.

So you will be better on with a scenario variable.

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

  parent reply	other threads:[~2020-06-18 12:13 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 [this message]
2020-06-18 16:44 ` Björn Lundin
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