Skip to content

Commit

Permalink
Allow the user to set build flags.
Browse files Browse the repository at this point in the history
  • Loading branch information
asarhaddon committed Oct 10, 2020
1 parent c19de47 commit 062dacd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/gnat/aunit.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ project AUnit is
for Library_Kind use "dynamic";
for Library_Version use "lib" & project'Library_name & ".so."
& AUnit_Shared.Soversion;
-- Put options like --as-needed before the libraries.
for Leading_Library_Options use AUnit_Shared.Ldflags;
end case;

for Library_Dir use "../aunit/"
Expand Down Expand Up @@ -51,6 +53,9 @@ project AUnit is
for Default_Switches ("ada") use
("-O2", "-gnatp", "-gnatn", "-gnatwa.X");
end case;
-- Allow user flags to override default flags.
for Default_Switches ("ada") use Compiler'Default_Switches ("ada")
& AUnit_Shared.Adaflags;

for Switches ("aunit.adb") use
Compiler'Default_Switches ("ada") & ("-fno-strict-aliasing");
Expand Down
3 changes: 3 additions & 0 deletions lib/gnat/aunit_shared.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ project AUnit_Shared is
-- A non-empty soversion requires a shared library.
Soversion := External ("aunit_SOVERSION", "");

Adaflags := External_As_List ("ADAFLAGS", " ");
Ldflags := External_As_List ("LDFLAGS", " ");

for Source_Dirs use ();

type Exception_Type is ("fullexception", "certexception", "zfpexception");
Expand Down

0 comments on commit 062dacd

Please sign in to comment.