-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathada_bar_codes.gpr
110 lines (95 loc) · 4.42 KB
/
ada_bar_codes.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
-- This is a GNAT, GCC or GNAT Studio project file
-- for the Ada Bar Codes project:
--
-- Home page: http://ada-bar-codes.sf.net/
-- Project page: http://sf.net/projects/ada-bar-codes/
-- Mirror: https://github.com/zertovitch/ada-bar-codes
-- Alire crate: https://alire.ada.dev/crates/bar_codes
--
-- Build me with "gprbuild -P ada_bar_codes", or "gnatmake -P ada_bar_codes",
-- or open me with GNAT Studio
--
project Ada_Bar_Codes is
type ABC_Build_Mode_Type is
("Debug",
"Fast",
"dynamic", "relocatable", -- shared library (PIC)
"static", -- static library (non PIC)
"static-pic"); -- static library (PIC)
ABC_Build_Mode : ABC_Build_Mode_Type := external ("ABC_Build_Mode", "Debug");
Adaflags := External_As_List ("ADAFLAGS", " ");
Ldflags := External_As_List ("LDFLAGS", " ");
Library_Version := External ("ABC_Library_Version", "libada_bar_codes.so.1");
for Create_Missing_Dirs use "True"; -- Flips by default the "-p" switch
case ABC_Build_Mode is
when "Debug" | "Fast" =>
for Source_Dirs use
(".", -- Library: Bar_Codes[.*]
"demo", -- Demos
"test"); -- Tests
for Main use
("bar_codes_demo.adb", -- Main demo
"bar_codes_test.adb"); -- Tests
for Exec_Dir use ".";
for Object_Dir use "obj/" & ABC_Build_Mode;
when "dynamic" | "relocatable" =>
for Source_Dirs use (".");
for Library_Name use "ada_bar_codes";
for Library_Kind use "relocatable";
for Library_Version use Library_Version;
for Leading_Library_Options use Ldflags;
for Library_Dir use "obj/relocatable-lib";
for Object_Dir use "obj/relocatable-obj";
when "static" | "static-pic" =>
for Source_Dirs use (".");
for Library_Name use "ada_bar_codes";
for Library_Kind use ABC_Build_Mode;
for Library_Dir use "obj/" & ABC_Build_Mode & "-lib";
for Object_Dir use "obj/" & ABC_Build_Mode & "-obj";
end case;
Compiler_Common_Options :=
("-gnatwaC", -- Warnings switches (a:turn on all info/warnings marked with +; C:turn off warnings for constant conditional)
"-gnatwh", -- Warnings switches (h:turn on warnings for hiding declarations)
"-gnatwijkmopruvz.c.p.t.w.x", -- Warnings switches (run "gnatmake" for full list)
"-gnatf", -- Full errors. Verbose details, all undefined references
"-gnatq", -- Don't quit, try semantics, even if parse errors
"-gnatQ") -- Don't quit, write ali/tree file even if compile errors
&
("-gnatyaknpr", -- Style: check all casings: a:attribute, k:keywords, n:package Standard identifiers, p:pragma, r:identifier references
"-gnatybfhiu", -- Style: check b:no blanks at end of lines, f:no ff/vtabs, h: no htabs, i:if-then layout, u:no unnecessary blank lines
"-gnatyxtc", -- Style: check x:no extra parens, t:token separation rules, c:comment format (two spaces)
"-gnatye", -- Style: check e:end/exit labels present
"-gnaty2", -- Style: check indentation
"-gnatyO") -- Style: check O:check overriding indicators
& Adaflags;
Compiler_Debug_Options :=
("-gnato", "-fno-inline", "-fstack-check", "-g", "-gnatVa") &
Compiler_Common_Options;
Compiler_Fast_Options :=
("-Ofast", "-gnatn") &
Compiler_Common_Options;
package Compiler is
case ABC_Build_Mode is
when "Debug" =>
for Local_Configuration_Pragmas use project'Project_Dir & "gnat/debug.pra";
for Default_Switches ("ada") use Compiler_Debug_Options;
when others =>
for Default_Switches ("ada") use Compiler_Fast_Options;
end case;
end Compiler;
package Binder is
-- -Es: Store tracebacks in exception occurrences, and enable symbolic tracebacks
for Default_Switches ("ada") use ("-Es");
end Binder;
package Builder is
-- "If -j0 is used, then the maximum number of simultaneous compilation
-- jobs is the number of core processors on the platform."
for Default_Switches ("ada") use ("-j0");
end Builder;
package Linker is
case ABC_Build_Mode is
when "Debug" => for Switches ("Ada") use Ldflags;
when others => null;
end case;
end Linker;
end Ada_Bar_Codes;