-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto_counters_examples.gpr
86 lines (69 loc) · 2.87 KB
/
auto_counters_examples.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
-- auto_counters_examples.gpr
-- Examples and Unit Tests for auto_counters.gpr
-- Copyright (c) 2016, James Humphry - see LICENSE for terms
with "auto_counters";
with "aunit";
project Auto_Counters_Examples is
type Mode_Type is ("debug", "memdebug", "coverage", "optimize");
Mode : Mode_Type := external ("mode", "debug");
case Mode is
when "debug"|"memdebug"|"coverage" =>
for Source_Dirs use ("examples", "tests", "tests/debug_config");
when "optimize" =>
for Source_Dirs use ("examples", "tests", "tests/optimize_config");
end case;
for Object_Dir use "build/";
for Exec_Dir use "exec/";
for Main use ("auto_counters_tests.adb",
"smart_ptr_example.adb",
"smart_ref_example.adb",
"unique_ptr_example.adb",
"c_resources_example.adb",
"flyweight_example.adb",
"kvflyweight_example.adb");
for Languages use ("Ada", "C");
package Ide is
for Vcs_Kind use "Git";
for Documentation_Dir use "doc/";
end Ide;
package Builder is
for Default_Switches ("ada") use ("-j2");
end Builder;
Debug_Compiler_Switches := ("-fstack-check", "-g", "-gnat2012",
"-gnata", "-gnatf", "-gnato",
"-gnatVa", "-gnatwa.f", "-gnatwZ",
"-gnatyaAbCdfhiknprux");
package Compiler is
case Mode is
when "debug"|"memdebug" =>
for Default_Switches ("ada") use Debug_Compiler_Switches;
for Default_Switches ("c") use ("-Wall", "-std=c99",
"-g", "-fdump-xref");
when "coverage" =>
for Default_Switches ("ada") use Debug_Compiler_Switches &
("-ftest-coverage", "-fprofile-arcs");
for Default_Switches ("c") use ("-Wall", "-std=c99",
"-g", "-fdump-xref");
when "optimize" =>
for Default_Switches ("ada") use ("-gnat2012", "-O2",
"-gnatn2", "-gnatp");
for Default_Switches ("c") use ("-Wall", "-std=c99",
"-O2", "-fdump-xref");
end case;
end Compiler;
package Linker is
case Mode is
when "debug" =>
for Default_Switches ("ada") use ("-g");
for Default_Switches ("c") use ("-g");
when "memdebug" =>
for Default_Switches ("ada") use ("-g", "-lgmem");
for Default_Switches ("c") use ("-g");
when "coverage" =>
for Default_Switches ("ada") use ("-g", "-fprofile-generate");
for Default_Switches ("c") use ("-g", "-fprofile-generate");
when "optimize" =>
for Default_Switches ("ada") use ();
end case;
end Linker;
end Auto_Counters_Examples;