From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED.2uCIJahv+a4XEBqttj5Vkw.user.gioia.aioe.org!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Checking for OS in gnatstudio project file(.gpr) Date: Thu, 18 Jun 2020 14:13:26 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <5eeb50d9$0$1208$e4fe514c@news.kpn.nl> NNTP-Posting-Host: 2uCIJahv+a4XEBqttj5Vkw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:59121 List-Id: 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