-
Notifications
You must be signed in to change notification settings - Fork 1
/
pdf_out_gnat.gpr
108 lines (96 loc) · 4.46 KB
/
pdf_out_gnat.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
-- This is a GNAT, GCC or GNAT Studio project file
-- for the Ada PDF Writer project (standalone variant).
--
-- This variant of the project file refers to a copy of the GID (Generic Image Decoder)
-- library included in a subdirectory. So, the project is standalone. But if *your* project
-- uses both Ada PDF Writer and GID project files, then the GID sources will be visible
-- at two different locations, and GNAT will rightfully complain about it.
-- In that case, you'd perhaps prefer to use the pdf_out_gnat_w_gid.gpr project file.
--
-- Home page: http://apdf.sf.net/
-- Project page 1: http://sf.net/projects/apdf/
-- Project page 2: https://github.com/zertovitch/ada-pdf-writer
--
-- Build me with "gprbuild -P pdf_out_gnat",
-- or "gnatmake -P pdf_out_gnat", or open me with GNAT Studio.
--
--
--
project PDF_Out_Gnat is
type PDF_Build_Mode_Type is ("Debug", "Fast");
PDF_Build_Mode : PDF_Build_Mode_Type := external ("PDF_Build_Mode", "Debug");
for Source_Dirs use
(".", "demos", "tools", "tests",
"gid" -- <--------- *Here* is the subdirectory with a copy of GID sources.
);
for Main use (
"pdf_out_demo.adb", -- Demos
"color_pinstripe_printer.adb",
"pinstripe_printer.adb",
"hilbert_curve.adb",
"koch_curve.adb",
"peano_curve.adb",
"sierpinski_arrowhead_curve.adb",
"img2pdf.adb", -- Tools
"validation_test.adb", -- Test
"page_test.adb"
);
for Exec_Dir use ".";
for Create_Missing_Dirs use "True"; -- Flips by default the "-p" switch
case PDF_Build_Mode is
when "Debug" =>
for Object_Dir use "obj_debug";
when "Fast" =>
for Object_Dir use "obj_fast";
end case;
Common_Options :=
(
"-gnatwa", -- Warnings switches (a:turn on all info/warnings marked with +)
-- "-gnatwh", -- Warnings switches (h:turn on warnings for hiding declarations)
-- "-gnatwcijkmopruvz.c.n.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
"-gnatyO", -- Style: check that overriding subprograms are explicitly marked as such.
"-gnatyx", -- Style: check x:no extra parens
"-gnatye", -- Style: check e:end/exit labels present
"-gnatyc", -- Style: check c:comment format (two spaces)
"-gnatyt" -- Style: check t:token separation rules
);
package Compiler is
case PDF_Build_Mode is
when "Debug" =>
for Local_Configuration_Pragmas use project'Project_Dir & "debug.pra";
for Default_Switches ("ada") use Common_Options &
("-gnato", "-fno-inline", "-fstack-check", "-g", "-gnatVa");
when "Fast" =>
for Default_Switches ("ada") use Common_Options &
("-O2", "-gnatn", "-gnatp", "-fno-strict-aliasing", "-funroll-loops", "-fpeel-loops", "-ftracer", "-funswitch-loops", "-fweb", "-frename-registers");
end case;
end Compiler;
package Linker is
case PDF_Build_Mode is
when "Debug" =>
for Default_Switches ("ada") use ("-g");
when "Fast" =>
for Default_Switches ("ada") use ("-g", "-s", "-Wl,--gc-sections");
end case;
end Linker;
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 Ide is
for Default_Switches ("adacontrol") use ("-f", "verif.aru");
end Ide;
end PDF_Out_Gnat;