comp.lang.ada
 help / color / mirror / Atom feed
* Problems passing compiler parameters in GPR files
@ 2016-11-13 13:45 Lucretia
  2016-11-14  8:28 ` briot.emmanuel
  0 siblings, 1 reply; 2+ messages in thread
From: Lucretia @ 2016-11-13 13:45 UTC (permalink / raw)


Hi,

I've been updating my bare bones project (https://github.com/Lucretia/bare_bones) to use a later version of GNAT (currently, 4.9).

I've run into a problem passing gnatmake parameters in the GPR files. I've set -gnaty-s and -gnatM120 for example and they both get ignored unless I add them to the i586-elf-gnatmake commandline.

I've managed to get the parameters to be recognised by doing this in the bare_bones.gpr:

   package Builder is
      Ada_Switches := ("-gnat2012", "-gnata", "-gnato", "-gnatE",
                       "-gnaty", "-gnaty-s", "-gnatyO", "-gnaty+M120", "-gnatyx",
                       "-gnaty+d", "-gnatv");
   end Builder;

   package Compiler is
      Ada_Switches := ("-ffunction-sections", "-fdata-sections") & Builder.Ada_Switches;
      --                         "-gnat2012", "-gnata", "-gnato", "-gnatE",
      --                         "-gnatyN", "-gnaty", "-gnaty-s", "-gnatyO", "-gnatyM120", "-gnatyx",
      --                         "-gnaty+d", "-gnatv");

I've no real clue why not having only those in the builder don't work. Can anyone explain?

Thanks,
Luke.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Problems passing compiler parameters in GPR files
  2016-11-13 13:45 Problems passing compiler parameters in GPR files Lucretia
@ 2016-11-14  8:28 ` briot.emmanuel
  0 siblings, 0 replies; 2+ messages in thread
From: briot.emmanuel @ 2016-11-14  8:28 UTC (permalink / raw)



> I've no real clue why not having only those in the builder don't work. Can anyone explain?

That's too many negatives in the same sentence, but your project is only declaring a variable, it isn't modifying any of the project attributes that the tools read. Also these are compiler switches, not builder switches.

    package Compiler is
        for Switches ("Ada") use ("-gnata", ....);
    end Compiler;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-14  8:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-13 13:45 Problems passing compiler parameters in GPR files Lucretia
2016-11-14  8:28 ` briot.emmanuel

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