comp.lang.ada
 help / color / mirror / Atom feed
From: Jere <jhb.chat@gmail.com>
Subject: GPRBuild: Reuse Default_Switches from an imported project
Date: Sun, 3 May 2020 10:08:45 -0700 (PDT)
Date: 2020-05-03T10:08:45-07:00	[thread overview]
Message-ID: <c32faa76-0ef8-446c-98b1-7fb3f5134da4@googlegroups.com> (raw)

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

             reply	other threads:[~2020-05-03 17:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-03 17:08 Jere [this message]
2020-05-03 17:14 ` GPRBuild: Reuse Default_Switches from an imported project Jere
2020-05-03 19:58 ` Simon Wright
2020-05-03 21:15   ` Jere
replies disabled

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