-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathshared.gpr.in
137 lines (112 loc) · 3.97 KB
/
shared.gpr.in
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
135
136
137
with "gnatcoll";
project Shared is
type OS_Type is ("unix", "osx", "Windows_NT");
OS : OS_Type := External ("OS", "unix");
type Build_Type is ("Debug", "Production", "AddressSanitizer");
Build : Build_Type := External ("BUILD", "Debug");
type Boolean_Type is ("true", "false");
Enable_LTO : Boolean_Type := "false";
-- Whether to enable link-time-optimization, and removal of
-- unused subprograms
Enable_Gperftools : Boolean_Type := "false";
-- Whether to enable profilling
-- gperftools sould be installed
Global_Objects_Root := External("GPS_OBJECTS_ROOT", "");
for Source_Dirs use ();
for Object_Dir use Global_Objects_Root & "obj";
for Library_Dir use "lib";
package Documentation is
for Documentation_Dir use Project'Object_Dir & "/html";
end Documentation;
package Compiler is
for Driver ("Python") use "";
Common := ("-g", "-gnatX");
Optimize := ();
case OS is
when "osx" | "Windows_NT" => null;
when "unix" =>
case Enable_LTO is
when "true" =>
Optimize := ("-fdata-sections", "-ffunction-sections",
"-flto");
when "false" =>
null;
end case;
end case;
case Build is
when "Debug" =>
for Switches ("Ada") use Common &
("-O0", "-gnata", "-gnatVa", "-gnatQ", "-gnatygO",
"-gnatwaCJe", "-gnateE", "-Wtrampolines");
for Switches ("C") use ("-g", "-O1");
when "Production" =>
for Switches ("Ada") use Common & Optimize &
("-O2", "-gnatn",
"-gnatT3", -- Temporary, L403-023.
"-gnatws",
"-gnatwaCJ",
"-gnatygO",
"-Wtrampolines"
);
for Switches ("C") use Optimize & ("-g", "-O2");
when "AddressSanitizer" =>
for Switches ("Ada") use Common &
("-O0", "-gnata", "-gnatVa", "-gnatQ", "-gnatygO",
"-gnatwaCJ", "-gnateE", "-fsanitize=address");
for Switches ("C") use ("-g", "-O1", "-fsanitize=address");
end case;
end Compiler;
package Binder is
for Switches ("Ada") use ("-E", "-shared");
end Binder;
Gtk_Cflags := (@GTK_GCC_FLAGS_GPR@);
Pygobject_Include := (@PYGOBJECT_INCLUDE_GPR@);
Python_cflags := (@PYTHON_CFLAGS_GPR@);
Python_shared_libs := (@PYTHON_SHARED_LIBS_GPR@);
package Linker is
-- ??? missing hack to force libiconv first (working around
-- a faulty libiconv in macports)
for Switches ("Ada") use Python_shared_libs;
case OS is
when "osx" =>
-- This ensure that location in which GNAT Studio looks for its
-- shared libraries can be changed.
for Switches ("Ada") use Linker'Switches ("Ada")
& ("-Wl,-headerpad_max_install_names");
when others =>
null;
end case;
case Enable_LTO is
when "true" =>
case OS is
when "osx" =>
for Switches ("Ada") use Linker'Switches ("Ada")
& ("-Wl,-dead_strip");
when "unix" =>
for Switches ("Ada") use Linker'Switches ("Ada")
& ("-Wl,--gc-sections", "-Wl,--print-gc-sections");
when others =>
null;
end case;
when "false" =>
null;
end case;
case Enable_Gperftools is
when "true" =>
for Switches ("Ada") use Linker'Switches ("Ada") &
("-lprofiler");
when "false" =>
null;
end case;
case Build is
when "AddressSanitizer" =>
for Switches ("Ada") use Linker'Switches ("Ada")
& ("-fsanitize=address");
when others =>
null;
end case;
end Linker;
package IDE is
for VCS_Kind use "git";
end IDE;
end Shared;