-
Notifications
You must be signed in to change notification settings - Fork 5
/
lea_project_tree.gpr
166 lines (147 loc) · 6.64 KB
/
lea_project_tree.gpr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
-- This is a GNAT, GCC or GNAT Studio project file
-- for the LEA project:
--
-- home page: http://l-e-a.sf.net/
-- project page: http://sf.net/projects/l-e-a/
-- mirror: https://github.com/zertovitch/lea
--
-- Build me with "gprbuild -P lea_project_tree", or open me with GNAT Studio
--
-- This variant is a hierarchical project, which refers to other projects.
-- See "lea.gpr" for the other variant.
--
-- *** External projects ***
-- *
-- * You need to make the following projects files visible to this project,
-- * for instance through the ADA_PROJECT_PATH environment variable:
-- *
-- * * GWindows and contributions:
-- * [gnavi]\gwindows\gwindows_contrib.gpr
-- * Project URL: http://sf.net/projects/gnavi/
-- * Mirror URL: https://github.com/zertovitch/gwindows
-- * NB: The Unicode (default) mode of GWindows is needed; in doubt, run [gnavi]\gwindows\unicode.cmd
-- *
-- * * HAC Ada Compiler:
-- * [hac]\hac.gpr
-- * Project URL: https://sourceforge.net/projects/hacadacompiler/
-- * Mirror URL: https://github.com/zertovitch/hac
-- *
-- * * Ini file manager:
-- * [ini]\ini_files.gpr
-- * Project URL: http://ini-files.sourceforge.net/
-- * Mirror URL: https://github.com/zertovitch/ini-files
-- *
-- * * Zip-Ada:
-- * [zip-ada]\zipada.gpr
-- * Project URL: http://unzip-ada.sf.net
-- * Mirror URL: https://github.com/zertovitch/zip-ada
-- *
-- * Example: ADA_PROJECT_PATH=
-- * ======= C:\Ada\gnavi\gwindows;
-- * C:\Ada\hac;
-- * C:\Ada\ini;
-- * C:\Ada\zip-ada
with "HAC";
with "Ini_Files";
with "ZipAda";
project LEA_Project_Tree extends "GWindows_Contrib" is
-- The `extends "GWindows_Contrib"` instead of `with "GWindows_Contrib"`
-- is a trick to handle the dependency of GWindows.Persistence_IO on the
-- package Config (which is in project Ini_Files).
type LEA_Build_Mode_Type is
("Debug",
"Debug_MinGW",
"Fast",
"Fast_MinGW",
"Small",
"Small_MinGW",
"Small_Unchecked"); -- Smallest size, at the price of less safety. Not for the release binary!
LEA_Build_Mode : LEA_Build_Mode_Type := external ("LEA_Build_Mode", "Debug");
for Main use ("lea_without_data.adb", "sample_catalogue.adb");
for Source_Dirs use (".");
for Exec_Dir use ".";
for Create_Missing_Dirs use "True"; -- Flips by default the "-p" switch
case LEA_Build_Mode is
when "Debug" => for Object_Dir use "obj/debug";
when "Fast" => for Object_Dir use "obj/fast";
when "Small" => for Object_Dir use "obj/small";
when "Debug_MinGW" => for Object_Dir use "obj/debug_ming";
when "Fast_MinGW" => for Object_Dir use "obj/fast_ming";
when "Small_MinGW" => for Object_Dir use "obj/small_ming";
when "Small_Unchecked" => for Object_Dir use "obj/small_unchecked";
end case;
Compiler_Common_Options :=
("-gnatwa", -- Warnings switches (a:turn on all info/warnings marked with +)
-- "-gnatwh", -- Warnings switches (h:turn on warnings for hiding declarations)
"-gnatwcijkmopruvz.c.p.t.w.x", -- Warnings switches (run "gnatmake" for full list)
"-gnatf", -- Full errors. Verbose details, all undefined references
"-gnatq", -- Don't quit, try semantics, even if parse errors
"-gnatQ", -- Don't quit, write ali/tree file even if compile errors
"-g", -- Generate debugging information
--
"-gnatyaknpr", -- Style: check all casings: a:attribute, k:keywords, n:package Standard identifiers, p:pragma, r:identifier references
"-gnatybfhiu", -- Style: check b:no blanks at end of lines, f:no ff/vtabs, h: no htabs, i:if-then layout, u:no unnecessary blank lines
"-gnatyx", -- Style: check x:no extra parens
"-gnatye", -- Style: check e:end/exit labels present
"-gnatyc", -- Style: check c:comment format (two spaces)
"-gnatyt"); -- Style: check t:token separation rules
Compiler_Debug_Options :=
("-gnata", -- Assertions enabled
"-gnato", -- Enable overflow checking in STRICT mode
"-gnatVa", -- Enable all validity checking options
"-fstack-check",
"-fno-inline") &
Compiler_Common_Options;
Compiler_Fast_Options :=
("-O3",
"-gnatpn",
"-g") &
Compiler_Common_Options;
Compiler_Profiling_Options :=
("-O2",
"-gnatp",
"-fno-inline",
"-pg") &
Compiler_Common_Options;
Compiler_Small_Options :=
("-Os",
-- "-fdata-sections",
"-ffunction-sections") &
Compiler_Common_Options;
package Compiler is
case LEA_Build_Mode is
when "Debug" | "Debug_MinGW" =>
for Default_Switches ("ada") use Compiler_Debug_Options;
for Local_Configuration_Pragmas use project'Project_Dir & "debug.pra";
when "Fast" | "Fast_MinGW" =>
for Default_Switches ("ada") use Compiler_Fast_Options;
for Local_Configuration_Pragmas use project'Project_Dir & "lea_elim.pra";
when "Small" | "Small_MinGW" =>
for Default_Switches ("ada") use Compiler_Small_Options;
for Local_Configuration_Pragmas use project'Project_Dir & "lea_elim.pra";
when "Small_Unchecked" =>
for Default_Switches ("ada") use Compiler_Small_Options & ("-gnatp");
for Local_Configuration_Pragmas use project'Project_Dir & "lea_elim.pra";
end case;
end Compiler;
Linker_Common_Options := ("-g", "lea.rbj", "-Xlinker", "--stack=0x2000000,0x20000");
Linker_Small_Options :=
Linker_Common_Options & ("-Wl,--gc-sections");
package Linker is
case LEA_Build_Mode is
when "Debug" | "Debug_MinGW" =>
for Default_Switches ("ada") use Linker_Common_Options;
when "Fast" | "Fast_MinGW" |
"Small" | "Small_MinGW" | "Small_Unchecked"=>
for Default_Switches ("ada") use Linker_Small_Options & ("-mwindows", "-s");
end case;
end Linker;
package Builder is
-- "If -j0 is used, then the maximum number of simultaneous compilation
-- jobs is the number of core processors on the platform."
for Default_Switches ("ada") use ("-j0");
end Builder;
package Ide is
for Default_Switches ("adacontrol") use ("-f", "verif.aru");
end Ide;
end LEA_Project_Tree;