-
Notifications
You must be signed in to change notification settings - Fork 0
/
troodon.gpr
135 lines (121 loc) · 3.63 KB
/
troodon.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
project Troodon is
type BuildOption is ("release", "debug");
BuildType : BuildOption := external ("build", "debug");
-- HOME := external ("HOME");
-- SDLADALIB := HOME & "/opt/sdlada/lib/sdlada.release";
-- SDLADASRC := HOME & "/opt/sdlada/include/sdlada.release";
-- TTK := "../DAGBuild/DAGBuild-master/src";
for Languages use ("ada", "yasm");
for Source_Dirs use ("src/**", "include/**");
for Object_Dir use "obj";
for Main use ("main.adb");
-- We "compile" shaders into ELF objects that we can link into our binary.
-- Note that this is different than the compilation of shaders that takes
-- place during runtime.
package Naming is
for Body_Suffix ("yasm") use ".asm";
end Naming;
package Linker is
case BuildType is
when "debug" =>
-- pg for profiler use
for Switches ("ada") use (
"-lxcb",
"-lxcb-ewmh",
"-lxcb-composite",
"-lxcb-glx",
"-lxcb-xfixes",
"-lxcb-damage",
"-lxcb-randr",
"-lxcb-render",
"-lxcb-shape",
"-lxcb-xinerama",
"-lX11-xcb",
"-lX11",
"-lGL",
"-lGLX",
"-lfontconfig",
"-lfreetype",
"-pg"
);
when "release" =>
for Switches ("ada") use (
"-lxcb",
"-lxcb-ewmh",
"-lxcb-composite",
"-lxcb-damage",
"-lxcb-glx",
"-lxcb-xfixes",
"-lxcb-randr",
"-lxcb-render",
"-lxcb-shape",
"-lxcb-xinerama",
"-lX11-xcb",
"-lX11",
"-lGL",
"-lGLX",
"-lfontconfig",
"-lfreetype",
"-ffunction-sections",
"-fdata-sections",
"-Wl,--gc-sections"
);
when others =>
null;
end case;
end Linker;
package Builder is
case BuildType is
when "debug" =>
for Executable ("main.adb") use "troodond";
when "release" =>
for Executable ("main.adb") use "troodon";
when others =>
null;
end case;
end Builder;
package Pretty_Printer is
for Default_Switches ("ada") use ("-M120", "-i4", "--no-separate-is", "-A0", "-A1", "-A2", "-A4", "-A5");
end Pretty_Printer;
package Binder is
case BuildType is
when "debug" =>
for Switches ("ada") use ("-Es");
when "release" =>
for Switches ("ada") use ("-shared");
when others =>
null;
end case;
end Binder;
package Compiler is
case BuildType is
when "debug" =>
for Switches ("ada") use (
"-gnat12",
"-gnatf",
"-gnateE",
"-g",
"-gnato",
"-fstack-check",
"-gnatE",
"-pg");
when "release" =>
for Switches ("ada") use (
"-flto",
"-gnat12",
"-O2",
"-mtune=native"
);
when others =>
null;
end case;
for Driver ("yasm") use "yasm";
for Object_File_Suffix ("yasm") use ".o";
for Object_File_Switches ("yasm") use ("-o","");
for Default_Switches ("yasm") use
(
"--arch=x86", "-felf64"
);
-- for Source_File_Switches ("asm") use ("-L", "");
end Compiler;
end Troodon;