From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a37:690:: with SMTP id 138mr6130461qkg.238.1588525726037; Sun, 03 May 2020 10:08:46 -0700 (PDT) X-Received: by 2002:a9d:337:: with SMTP id 52mr11242545otv.178.1588525725725; Sun, 03 May 2020 10:08:45 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 3 May 2020 10:08:45 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=70.109.61.2; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 70.109.61.2 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: GPRBuild: Reuse Default_Switches from an imported project From: Jere Injection-Date: Sun, 03 May 2020 17:08:46 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:58567 Date: 2020-05-03T10:08:45-07:00 List-Id: I have an embedded library X that I want to import into a project Y. In project X I have (among other things) for Runtime ("Ada") use Project'Project_Dir & "/runtime"; for Target use "arm-eabi"; package Compiler is case Build_Mode is when "debug" => for Default_Switches ("ada") use ("-O0", "-gnatwa.X", "-gnatQ", "-gnat12", "-g"); when "release" => for Default_Switches ("ada") use ("-O2", "-gnatQ", "-gnatw.X", "-gnat12", "-gnatn", "-ffunction-sections", "-fdata-sections"); end case; end Compiler; In project Y, I with project X: with "path/X.gpr" and I am able to do the following just fine: for Runtime ("Ada") use X'Runtime("Ada"); But when I try to use the Default_Switches in the same manner it gives me errors y.gpr:23:46: wrong expression kind for attribute "default_switches" y.gpr:23:64: unknown variable "Default_Switches" For reference I am trying the syntax: package Compiler is case Build_Mode is when "debug" => for Default_Switches ("ada") use X.Compiler.Default_Switches("ada"); when "release" => for Default_Switches ("ada") use X.Compiler.Default_Switches("ada"); end case; end Compiler; I even tried putting them inside a set of parenthesis, but with no luck. I am guessing I need some way to indicate which case the default switches are from, but am unsure. It may not even be possible. Anyone know how to do this or if it possible