forked from alire-project/alire
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalire_common.gpr
95 lines (74 loc) · 2.89 KB
/
alire_common.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
abstract project Alire_Common is
for Create_Missing_Dirs use "True";
type Host_OSes is ("linux",
"freebsd",
"macos",
"windows");
Host_OS : Host_OSes := external ("ALIRE_OS");
-- Set by user or in alire.toml
type Any_Build_Mode is ("debug", "release");
Build_Mode : Any_Build_Mode := external ("ALIRE_BUILD_MODE", "debug");
-- Profile for the build, depending on the use case. Debug favors
-- debuggability (for developper convenience) while release favors
-- optimizations.
type Any_Style_Check_Mode is ("enabled", "disabled");
Style_Check_Mode : Any_Style_Check_Mode :=
external ("ALIRE_STYLE_CHECK_MODE", "enabled");
Style_Check_Switches := ();
case Style_Check_Mode is
when "enabled" => Style_Check_Switches :=
("-gnatyg", -- Standard checks
"-gnatyI", -- no IN mode
"-gnatyO", -- all overrides
"-gnaty-s"); -- relax fwd decl
when "disabled" => Style_Check_Switches := ();
end case;
Ada_Common_Switches :=
( "-gnatW8" -- use UTF-8 Encoding for Source Files
, "-s" -- Recompile if compiler Switches Have Changed
);
package Compiler is
case Build_Mode is
when "debug" =>
for Default_Switches ("Ada") use Ada_Common_Switches &
(
-- Build with no optimization in debug mode
"-g", "-O0",
-- Enable lots of extra runtime checks
"-gnatVa", "-gnato", "-fstack-check", "-gnata",
-- Enable full errors, verbose details
"-gnatf",
-- Report Elaboration Circularity Details
"-gnatd_F",
-- Enable all warnings and treat them as errors
"-gnatwae")
& Style_Check_Switches;
for Default_Switches ("C") use ("-g", "-O0", "-Wall");
-- Likewise for C units
when "release" =>
for Default_Switches ("Ada") use Ada_Common_Switches &
(
-- Build with lots of optimizations. Generate debug info
-- (useful for tracebacks).
"-O2", "-g",
-- Generate position-independent code
"-fPIC",
-- Enable lots of extra runtime checks
"-gnatVa", "-gnatwa", "-gnato", "-fstack-check", "-gnata",
"-gnatf", "-fPIC")
& Style_Check_Switches;
for Default_Switches ("C") use ("-g", "-O2", "-Wall", "-fPIC");
-- Likewise for C units
end case;
end Compiler;
package Builder is
for Switches ("Ada") use ("-s", "-j0", "-g");
end Builder;
package Binder is
for Switches ("Ada") use
( "-Es", "-g", "-static");
end Binder;
package Ide is
for Vcs_Kind use "Git";
end Ide;
end Alire_Common;