From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?Bj=c3=b6rn_Lundin?= Newsgroups: comp.lang.ada Subject: Re: Raising "exception" in a .gpr file Date: Fri, 13 Aug 2021 17:40:02 +0200 Organization: A noiseless patient Spider Message-ID: References: <3e9e65ca-75a8-4df9-813d-8b053ecedd9fn@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 13 Aug 2021 15:40:02 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="63d6850711691d77a3ef1ba54d2317ea"; logging-data="12336"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18TGaruhZqPymgbAu2SZXug" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 Cancel-Lock: sha1:3G603sYWBz0qLPbmhU7LSXusb2Q= In-Reply-To: <3e9e65ca-75a8-4df9-813d-8b053ecedd9fn@googlegroups.com> Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:62499 List-Id: Den 2021-08-13 kl. 10:11, skrev mockturtle: > On Friday, August 13, 2021 at 9:44:13 AM UTC+2, Dmitry A. Kazakov wrote: >> There are many nice addition they could have, starting with predefined >> variables for the host OS, host machine and a sane set of operations >> defined on strings. > > I agree. With just few additions the project files would much more powerful and easier to use. > I autogenerate such a file via a tcl-script as part of calling make. It has to be done at least once - GPS it uses the file as is (they are on 1 line but Thunderbird thinks they are too long) --This file is autogenerated - DO NOT EDIT --contents is from ada -z and ada -Z and some environment variables --generated 2021-06-21 19:21:34 project Environment is for Source_Dirs use (); -- to avoid warnings about no source files in THIS project type Compiler_Version_Type is ("2015", "2016", "2017", "2018", "4.9.2", "6.0.2", "7.1.1", "7.3.2", "7.4.1", "7.4.2", "7.4lts", "7.4ltsw", "17.2", "19.0w", "19.1", "19.2", "20.1", "20.2", "8.2.0", "9.3.0"); type OS_Version_Type is ("AIX_7.1", "AIX_7.2", "windows_6.2", "windows_10.0", "Linux_x86_64", "Linux_aarch64"); type Database_Type is ("oracle_10", "oracle_11", "oracle_12", "sqlserver", "oci", "odbc_oracle", "odbc_postgresql", "postgresql"); type OS_Architecture_Type is ("aix_ppc", "win_x86", "lnx_x64", "win_x64", "lnx_a64"); type IPC_Type is ("classic", "pipe", "rabbitmq"); OS_Version : OS_Version_Type := "Linux_x86_64"; OS_Architecture : OS_Architecture_Type := "lnx_x64"; IPC : IPC_Type := "pipe"; Compiler_Version : Compiler_Version_Type := "20.2"; Database : Database_Type := "oci"; Database_Version := "12"; Source_Dir := "/usr2/wcs/some_project/source"; Target_Dir := "/usr2/wcs/some_project/target"; Ada_Library_Root := "/usr2/wcs/some_project/target/adalib"; Ada_Library_Global := "/usr2/wcs/some_project/target/adalib/global_gpr"; end Environment; Environment is then withed by other gpr files and used as with "environment"; ... project Global is Target_Machine : Environment.OS_Version_Type := Environment.Os_Version; Compiler_Version : Environment.Compiler_Version_Type := Environment.Compiler_Version; Data_Base : Environment.Database_Type := Environment.Database; IPC : Environment.IPC_Type := Environment.IPC; ... when "Linux_x86_64" => case Database is when "oci" => Database_Libs := ("-L" & SOMEPATHE & "/lib", "-lclntsh", "-L" & SATTMATE_OCILIB & "/lib", "-locilib"); when "sqlserver" => Data_Base_Libs := ("-lodbc"); when "odbc_oracle" => Data_Base_Libs := ("-lodbc"); when "odbc_postgresql" => Data_Base_Libs := ("-lodbc"); when others => null; end case; Platform_Dependent_Compiler_Switches := (); case IPC is when "classic" | "pipe" => case RPC_Enabled is when "false" => null; when "true" => -- Björn