-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathacc.gpr
More file actions
116 lines (99 loc) · 4.09 KB
/
acc.gpr
File metadata and controls
116 lines (99 loc) · 4.09 KB
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
-- -----------------------------------------------------------------------------
-- Acc, the software architecture compliance verifier
-- Copyright (C) 2005, 2006, 2009, 2017, 2018 - Lionel Draghi
-- This program is free software;
-- you can redistribute it and/or modify it under the terms of the GNU General
-- Public License Versions 3, refer to the COPYING file.
-- -----------------------------------------------------------------------------
with "list_image";
with "opentoken";
project Acc is
type Mode_Type is ("development", "release");
Mode : Mode_Type := external ("mode", "development");
-- development is the default alr mode
for Source_Dirs use ("src/", "src/Alire_config/");
for Object_Dir use "obj";
for Create_Missing_Dirs use "True";
for Main use ("acc-main.adb");
for Exec_Dir use "obj/";
package Ide is
-- for Documentation_Dir use "./html";
for Vcs_Kind use "Git";
end Ide;
package Builder is
for Executable ("acc-main.adb") use "acc"; -- "archicheck";
for Default_Switches ("ada") use ("-j2", "-g", "-m");
end Builder;
package Coverage is
for Ignored_Source_Files use ("*main*.ad[sb]");
-- bug with toolchain.use.gnat=gnat_native=13.2.2
-- the generated instrumented code doesn't compile
-- archicheck-main.adb:36:97: error: stub cannot appear in an inner scope
-- ...
end Coverage;
package Compiler is
Common_Switches := ("-gnat2022");
Common_Debug_Switches := Common_Switches &
("-g", "-O0", "-gnatQ", "-gnatf",
"-gnato", "-fstack-check", "-gnata",
"-gnateE", "-gnatVa", "-gnatwa", "-gnatyaefhiklnprtx");
-- "-gnateE", "-gnatVa", "-gnatwa", "-gnatW8", "-gnatyaefhiklnprtx");
-- -gnatQ : Don't quit
-- -gnatf : Full errors
-- -gnato : Intermediate overflows to be handled in strict mode.
-- -fstack-check : stack checking
-- -gnata : assertions
-- -gnateE : extra infos in exception messages
-- -gnatVa : all validity checks
-- -gnatwa : activate most optional warning messages
-- -gnatW8 : UTF-8 encodings recognized (Char="≠" is easier to undestand than Char=["2260"])
--
-- Style checking :
-- a : Check attribute casing
-- removed b : Blanks not allowed at statement end
-- (Because of Markdown processing for comments : double
-- final blank is used in MD to force a newline)
-- e : Check end/exit labels
-- f : No form feeds or vertical tabs
-- h : No horizontal tabs
-- i : Check if-then layout
-- k : Check keyword casing
-- l : Check layout
-- n : Check casing of entities in Standard
-- p : Check pragma casing
-- r : Check references
-- t : Check token spacing
-- removed M100 : Set maximum line length
-- x : Check extra parentheses.
case Mode is
when "development" =>
for Switches ("ada") use Common_Debug_Switches;
-- -pg : profiling
-- coverage only for acc src files :
for Switches ("archicheck*") use Common_Debug_Switches; -- & "--coverage";
-- --coverage = -fprofile-arcs and -ftest-coverage
when "release" =>
for Switches ("ada") use Common_Switches & ("-O3", "-flto");
-- -flto : link time optimization
end case;
end Compiler;
package Binder is
case Mode is
when "development" => for Switches ("ada") use ("-Es");
-- -Es : store symbolic tracebacks
when "release" => for Switches ("ada") use ("-static");
-- -static : link against a static GNAT run time.
end case;
end Binder;
package Linker is
case Mode is
when "development" => for Switches ("ada") use ("-g", "--coverage", "-pg");
-- pg : profiling
when "release" => for Switches ("ada") use ("-flto");
-- -flto : link time optimization
end case;
end Linker;
package Pretty_Printer is
for Switches ("ada") use ("-M100", "-l2", "-A1", "-A2", "-A3", "-A4");
end Pretty_Printer;
end Acc;