-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
gid.gpr
132 lines (117 loc) · 5.03 KB
/
gid.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
-- This is a GNAT, GCC or GNAT Studio project file
-- for the Generic Image Decoder project:
--
-- Home page: http://gen-img-dec.sf.net/
-- Project page: http://sf.net/projects/gen-img-dec/
-- Mirror: https://github.com/zertovitch/gid
-- Alire crate: https://alire.ada.dev/crates/gid
--
-- Build me with "gprbuild -P gid", or "gnatmake -P gid",
-- or open me with GNAT Studio.
--
project GID is
for Source_Dirs use (".", "test");
for Exec_Dir use "test";
for Create_Missing_Dirs use "True"; -- Flips by default the "-p" switch
type GID_Build_Mode_Type is
("Debug",
"Fast_but_checked",
"Fast_unchecked",
"Small",
"Smallest",
"Profiling");
GID_Build_Mode : GID_Build_Mode_Type := external ("GID_Build_Mode", "Debug");
for Main use
("to_png.adb",
"to_bmp.adb",
"mini.adb",
-- Tests / Tools
"all_rgb.adb",
"benchmark.adb",
"color_avg.adb",
"comp_img.adb",
"is_opaque.adb",
"recurve.adb",
"steg.adb");
case GID_Build_Mode is
when "Debug" =>
for Object_Dir use "obj/debug";
when "Fast_unchecked" =>
for Object_Dir use "obj/fast_unchecked";
when "Fast_but_checked" =>
for Object_Dir use "obj/fast_checked";
when "Small" =>
for Object_Dir use "obj/small";
when "Smallest" =>
for Object_Dir use "obj/smallest";
when "Profiling" =>
for Object_Dir use "obj/profiling";
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
&
("-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
"-gnatyO", -- Style: check that overriding subprograms are explicitly marked as such.
"-gnatyx", -- Style: check x:no extra parens
"-gnatye", -- Style: check e:end/exit labels present
"-gnatyt", -- Style: check t:token separation rules
"-gnatyc"); -- Style: check c:comment format (two spaces)
Compiler_Fast_Options :=
("-Ofast") &
Compiler_Common_Options;
Compiler_Small_Options :=
("-Os", "-ffunction-sections", "-falign-jumps=0", "-falign-loops=0", "-falign-functions=0") &
Compiler_Common_Options;
Compiler_Debug_Options :=
(-- "-gnateV", -- Validity check for parameters, GNAT > 4.6, redundant with -gnatVim ?
"-gnatVa", -- Turn on all validity checking options
"-gnato", -- Enable overflow checking in STRICT (-gnato1) mode
"-g",
"-fno-inline", "-fstack-check") &
Compiler_Common_Options;
package Compiler is
case GID_Build_Mode is
when "Debug" =>
for Local_Configuration_Pragmas use project'Project_Dir & "debug.pra";
for Default_Switches ("ada") use Compiler_Debug_Options ;
when "Fast_but_checked" =>
for Default_Switches ("ada") use Compiler_Fast_Options & ("-gnatn", "-ffunction-sections");
when "Fast_unchecked" =>
for Default_Switches ("ada") use Compiler_Fast_Options & ("-gnatpn", "-ffunction-sections");
when "Profiling" =>
for Default_Switches ("ada") use Compiler_Fast_Options & ("-gnatp", "-fno-inline", "-g", "-pg");
when "Small" =>
for Default_Switches ("ada") use Compiler_Small_Options & ("-gnatpn");
when "Smallest" =>
for Default_Switches ("ada") use Compiler_Small_Options & ("-gnatp", "-fno-inline");
end case;
end Compiler;
package Linker is
case GID_Build_Mode is
when "Debug" =>
for Default_Switches ("ada") use ("-g");
when "Fast_unchecked" | "Fast_but_checked" | "Small" | "Smallest" =>
for Default_Switches ("ada") use ("-g", "-s", "-Wl,--gc-sections");
when "Profiling" =>
for Default_Switches ("ada") use ("-g", "-pg");
end case;
end Linker;
package Binder is
-- -Es: Store tracebacks in exception occurrences, and enable symbolic tracebacks
for Default_Switches ("ada") use ("-Es");
end Binder;
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 GID;