@@ -12,6 +12,11 @@ library project Langkit_Support is
12
12
Library_Kind_Param : Library_Kind_Type := external
13
13
("LIBRARY_TYPE", external ("LANGKIT_SUPPORT_LIBRARY_TYPE", "static"));
14
14
15
+ SO_Name := External ("LANGKIT_SONAME", "");
16
+
17
+ Ada_Flags := External_As_List ("ADAFLAGS", " ");
18
+ Ld_Flags := External_As_List ("LDFLAGS", " ");
19
+
15
20
for Languages use ("Ada");
16
21
for Source_Dirs use (".");
17
22
for Object_Dir use "obj/" & Build_Mode;
@@ -65,20 +70,33 @@ library project Langkit_Support is
65
70
66
71
for Library_Dir use "lib/" & Library_Kind_Param & "/" & Build_Mode;
67
72
73
+ case Library_Kind_Param is
74
+ when "relocatable" =>
75
+ case SO_Name is
76
+ when "" =>
77
+ null;
78
+ when others =>
79
+ for Library_Version use SO_Name;
80
+ end case;
81
+ for Leading_Library_Options use Ld_Flags;
82
+ when "static" | "static-pic" =>
83
+ null;
84
+ end case;
85
+
68
86
Common_Ada_Cargs := ("-gnatwa", "-gnatyg", "-fPIC");
69
87
70
88
package Compiler is
89
+ Mode_Args := ();
71
90
case Build_Mode is
72
91
when "dev" =>
73
- for Default_Switches ("Ada") use
74
- Common_Ada_Cargs & ("-g", "-O0", "-gnatwe", "-gnata");
75
-
92
+ Mode_Args := ("-g", "-O0", "-gnatwe", "-gnata");
76
93
when "prod" =>
77
94
-- Debug information is useful even with optimization for
78
95
-- profiling, for instance.
79
- for Default_Switches ("Ada") use
80
- Common_Ada_Cargs & ("-g", "-Ofast");
96
+ Mode_Args := ("-g", "-Ofast");
81
97
end case;
98
+ for Default_Switches ("Ada") use Common_Ada_Cargs & Mode_Args
99
+ & Ada_Flags;
82
100
end Compiler;
83
101
84
102
end Langkit_Support;
0 commit comments