-
Notifications
You must be signed in to change notification settings - Fork 9
/
shared.gpr
110 lines (85 loc) · 2.8 KB
/
shared.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
--
-- Copyright (C) 2019-2024, AdaCore
--
-- SPDX-License-Identifier: Apache-2.0
--
abstract project Shared is
type Build_Type is ("debug", "release", "release_checks", "gnatcov");
Build : Build_Type := external ("GPR2_BUILD", "debug");
type Profiler_Flag is ("yes", "no");
Profiler : Profiler_Flag := external ("PROFILER", "no");
type Bool is ("true", "false");
Is_Externally_Built : Bool := external ("EXTERNALLY_BUILT", "false");
for Externally_Built use Is_Externally_Built;
Processors := external ("PROCESSORS", "0");
Build_Root := external ("BUILD_ROOT", Project'Project_Dir & ".build");
type Library_Kind is ("static", "relocatable", "static-pic");
Library_Type : Library_Kind :=
external ("GPR2_LIBRARY_TYPE", external ("LIBRARY_TYPE", "static"));
--------------
-- Compiler --
--------------
Common_Options :=
("-gnatwcfijkmqrtuvwz", "-gnaty3abBcdefhiIklmnoOprstx");
-- Common options used for the Debug and Release modes
case Profiler is
when "yes" =>
Common_Options := Common_Options & "-pg";
when "no" =>
null;
end case;
Checks_Options :=
("-gnata", "-gnatVa", "-gnato", "-fstack-check");
-- Common options used to enable checking for the Debug and Release_Checks
-- modes
Debug_Options :=
("-g", "-gnatQ", "-gnatwe");
Release_Options :=
("-O2", "-gnatn");
Langkit_Parser_Options := ("-g");
package Compiler is
case Build is
when "debug" | "gnatcov" =>
for Default_Switches ("Ada") use Common_Options & Checks_Options &
Debug_Options;
for Default_Switches ("C") use ("-g");
for Default_Switches ("gnatcov*") use Debug_Options;
when "release_checks" =>
for Default_Switches ("Ada") use Common_Options & Checks_Options &
Release_Options;
for Default_Switches ("C") use ("-O2");
when "release" =>
for Default_Switches ("Ada") use Common_Options & Release_Options;
for Default_Switches ("C") use ("-O2");
end case;
end Compiler;
------------
-- Binder --
------------
package Binder is
for Default_Switches ("Ada") use ("-Es");
end Binder;
-------------
-- Builder --
-------------
package Builder is
for Switches (others) use ("-j" & Processors);
end Builder;
------------
-- Linker --
------------
package Linker is
case Profiler is
when "yes" =>
for Switches ("Ada") use ("-pg");
when "no" =>
null;
end case;
end Linker;
--------------
-- Coverage --
--------------
package Coverage is
for Excluded_Units use ("gpr_parser*");
end Coverage;
end Shared;