Skip to content

Commit 3caf70b

Browse files
committed
Allow the user to set build flags
1 parent 5d5c0d0 commit 3caf70b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/gnat/aunit.gpr

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ project AUnit is
2727
for Library_Version use
2828
external ("AUNIT_LIBRARY_VERSION", "libaunit.so.0.0");
2929

30+
case AUnit_Shared.Library_Kind is
31+
when "dynamic" | "relocatable" =>
32+
-- Put options like --as-needed before the libraries.
33+
for Leading_Library_Options use external_As_List ("LDFLAGS", " ");
34+
when others =>
35+
end case;
36+
3037
--------------
3138
-- Compiler --
3239
--------------
@@ -43,6 +50,10 @@ project AUnit is
4350
("-O2", "-gnatp", "-gnatn", "-gnatwa.X");
4451
end case;
4552

53+
-- Allow user flags to override default flags.
54+
for Default_Switches ("ada") use
55+
Compiler'Default_Switches ("ada") & external_As_List ("ADAFLAGS", " ");
56+
4657
for Switches ("aunit.adb") use
4758
Compiler'Default_Switches ("ada") & ("-fno-strict-aliasing");
4859
end Compiler;

0 commit comments

Comments
 (0)