forked from yet-another-static-site-generator/yass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
yass.gpr
113 lines (100 loc) · 3.27 KB
/
yass.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
with "aws";
with "xmlada";
project yass is
for Main use ("yass.adb");
for Source_Dirs use ("src/**");
for Object_Dir use "obj";
for Exec_Dir use "bin";
for Create_Missing_Dirs use "True";
type Mode_Type is ("dev", "debug", "release", "analyze");
Mode : Mode_Type := external ("Mode", "dev");
type OS_Type is ("Windows", "Unix");
OS : OS_Type := external ("OS", "Unix");
type CMark_Type is ("cmark", "cmark-gfm");
CMark : CMark_Type := external ("YASS_CMark", "cmark");
CMark_Link_Switch := "-l" & CMark;
package Builder is
case Mode is
when "release" =>
for Default_Switches("ada") use ("-j0", "-gnat2012");
when others =>
for Default_Switches("ada") use ("-j0", "-gnat2012", "-g");
for Global_Configuration_Pragmas use "gnat.adc";
end case;
end Builder;
package Binder is
case Mode is
when "dev" =>
for Default_Switches ("Ada") use ("-E");
when "debug" | "analyze" =>
for Default_Switches("ada") use ("-E", "-shared");
when "release" =>
for Default_Switches("ada") use ("-static");
end case;
end Binder;
package Compiler is
case Mode is
when "dev" | "debug" =>
for Default_Switches ("ada") use ("-gnatwa",
"-fstack-check",
"-gnatVa",
"-gnatU",
"-gnatf",
"-gnateE",
"-gnaty3aAbCdefhIklnOprSux",
"-gnatwe");
when "release" =>
for Default_Switches ("ada") use ("-O2",
"-ffunction-sections",
"-fdata-sections",
"-s",
"-flto");
when "analyze" =>
for Default_Switches ("ada") use ("-pg",
"-fprofile-arcs",
"-ftest-coverage");
end case;
end Compiler;
package Linker is
Release_Switches := ("-Wl,--gc-sections",
"-s",
"-O2",
Cmark_Link_Switch,
"-flto");
case Mode is
when "dev" =>
for Default_Switches ("Ada") use (CMark_Link_Switch);
when "debug" =>
for Default_Switches ("ada") use ("-no-pie", CMark_Link_Switch);
when "release" =>
case OS is
when "Windows" =>
for Default_Switches ("ada") use Release_Switches &
"-L/opt/lib";
when "Unix" =>
for Default_Switches ("ada") use Release_Switches &
"-Wl,-rpath,$ORIGIN/../lib";
end case;
when "analyze" =>
for Default_Switches ("ada") use ("-no-pie",
"-pg",
"-fprofile-arcs",
CMark_Link_Switch);
end case;
end Linker;
package Pretty_Printer is
for Default_Switches("ada") use ("--RM-style-spacing",
"--no-separate-loop-then",
"--no-separate-is",
"-rnb",
"-c0");
end Pretty_Printer;
package GnatTest is
for Tests_Dir use "../tests";
for Harness_Dir use "../tests/driver";
for GnatTest_Switches use ("--omit-sloc",
"--test-case-only",
"--passed-tests=hide",
"--exit-status=on");
end GnatTest;
end yass;