Skip to content

Commit 20bf52a

Browse files
asarhaddonTurboGit
authored andcommitted
Pass ADAFLAGS to include.gpr and add CPPFLAGS to CFLAGS.
This patch does not apply the common style flags to include/*, it only allow explicit user flags (ADAFLAGS) to override default flags. The External is in shared.gpr so that there is only one environment lookup for each variable.
1 parent 1db53e9 commit 20bf52a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

include/include.gpr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ library project Include is
6464
when others =>
6565
null;
6666
end case;
67+
68+
for Default_Switches ("Ada") use
69+
Compiler'Default_Switches ("Ada")
70+
& Shared.Adaflags;
6771
end Compiler;
6872

6973
-------------

shared.gpr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ abstract project Shared is
9090

9191
Adaflags := External_As_List ("ADAFLAGS", " ");
9292
Cflags := External_As_List ("CFLAGS", " ");
93+
Cppflags := External_As_List ("CPPFLAGS", " ");
9394
Ldflags := External_As_List ("LDFLAGS", " ");
9495

9596
---------
@@ -157,7 +158,7 @@ abstract project Shared is
157158
for Default_Switches ("Ada") use
158159
Compiler'Default_Switches ("Ada") & Adaflags;
159160
for Default_Switches ("C") use
160-
Compiler'Default_Switches ("C") & Cflags;
161+
Compiler'Default_Switches ("C") & Cflags & Cppflags;
161162

162163
end Compiler;
163164

0 commit comments

Comments
 (0)