-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
aoc_2023.gpr
113 lines (95 loc) · 3.86 KB
/
aoc_2023.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
-- This is a GNAT, GCC or GNAT Studio project file
-- for the Advent of Code 2023 examples.
--
-- Some programs work with both HAC and "full Ada" compilers like,
-- GNAT some (titled *_full_ada.adb) work only with "full Ada".
--
project AoC_2023 is
for Source_Dirs use (
".",
"../../../src" -- GNAT's access to the HAT package.
);
for Exec_Dir use ".";
for Create_Missing_Dirs use "True";
type AoC_Build_Mode_Type is
("Debug",
"Fast");
AoC_Build_Mode : AoC_Build_Mode_Type := external ("AoC_Build_Mode", "Debug");
type AoC_Styles_Checks_Type is
("Level_0",
"Level_1",
"Level_2");
AoC_Styles_Checks : AoC_Styles_Checks_Type := external ("AoC_Styles_Checks", "Level_1");
for Main use
("aoc_2023_10.adb",
"aoc_2023_09.adb",
"aoc_2023_08.adb",
"aoc_2023_07.adb",
"aoc_2023_06.adb",
"aoc_2023_05.adb",
"aoc_2023_04.adb",
"aoc_2023_03.adb",
"aoc_2023_02.adb",
"aoc_2023_01.adb");
case AoC_Build_Mode is
when "Debug" =>
for Object_Dir use "obj_debug";
when "Fast" =>
for Object_Dir use "obj_fast";
end case;
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
Style_Checks_1 :=
("-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
"-gnatytc"); -- Style: check t:token separation rules, c:comment format (two spaces)
Style_Checks_2 :=
("-gnatye"); -- Style: check e:end/exit labels present
case AoC_Styles_Checks is
when "Level_0" => null;
when "Level_1" => Common_Options := Common_Options & Style_Checks_1;
when "Level_2" => Common_Options := Common_Options & Style_Checks_1 & Style_Checks_2;
end case;
Fast_Options := (
"-Ofast"
);
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"
);
package Compiler is
case AoC_Build_Mode is
when "Debug" =>
for Default_Switches ("ada") use Common_Options & Debug_Options ;
when "Fast" =>
for Default_Switches ("ada") use Common_Options & Fast_Options & ("-gnatpn", "-ffunction-sections");
end case;
end Compiler;
package Linker is
case AoC_Build_Mode is
when "Debug" =>
for Default_Switches ("ada") use ("-g");
when "Fast" =>
for Default_Switches ("ada") use ("-g", "-s", "-Wl,--gc-sections");
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;
end AoC_2023;