alire icon indicating copy to clipboard operation
alire copied to clipboard

Build flag

Open pjljvandelaar opened this issue 2 years ago • 2 comments

In my old gpr file, the "-s" flag (recompile if compiler switches have changed since last compilation) was added to the Builder:

 package Builder is
...
end Builder;

With alire, I see that the build phase has flags

Command ["gprbuild", "-gnatwU", "-j0", "-p", "-P", "tests.gpr"]

but not the "-s"flag.

Is this flag not needed? If so, why? If not, how to add it? If I need to make changes to the generated gpr file, do you have recommendations to separate changes from generated code?

pjljvandelaar avatar Mar 23 '22 14:03 pjljvandelaar

Hello @pjljvandelaar

Is this flag not needed?

The definition of -s for gprbuild is: "recompile if compilation switches have changed" So this is indeed optional.

Now I see why you want to use this switch so you have two options:

  • 1: You can still have a package Builder with the -s switch in your project file:
    package Builder is
     for Default_Switches ("Ada") use ( "-s");
    end Builder;
    
  • 2: You can pass the -s to gprbuild option when running alr build: $ alr build -- -s

For the longer term, @mosteo we should consider always having the -s switch when running gprbuild.

Fabien-Chouteau avatar Mar 25 '22 17:03 Fabien-Chouteau

For the longer term, @mosteo we should consider always having the -s switch when running gprbuild.

Sounds like a sensible default

mosteo avatar Mar 28 '22 09:03 mosteo