|
1 | | -with "templates_parser.gpr"; |
2 | | -with "gnatcoll"; |
3 | | -with "gpr"; |
4 | | - |
| 1 | +with "config/startup_gen_config.gpr"; |
5 | 2 | project Startup_Gen is |
6 | 3 |
|
7 | | - for Languages use ("Ada"); |
8 | | - for Source_Dirs use ("src"); |
9 | | - for Main use ("main.adb"); |
10 | | - for Object_Dir use "obj/"; |
11 | | - for Exec_Dir use "."; |
| 4 | + for Source_Dirs use ("src/", "config/"); |
| 5 | + for Object_Dir use "obj/" & Startup_Gen_Config.Build_Profile; |
12 | 6 | for Create_Missing_Dirs use "True"; |
13 | | - |
14 | | - |
15 | | - type Enabled_Kind is ("enabled", "disabled"); |
16 | | - Compile_Checks : Enabled_Kind := External ("STARTUP_GEN_COMPILE_CHECKS", "disabled"); |
17 | | - Runtime_Checks : Enabled_Kind := External ("STARTUP_GEN_RUNTIME_CHECKS", "enabled"); |
18 | | - Style_Checks : Enabled_Kind := External ("STARTUP_GEN_STYLE_CHECKS", "disabled"); |
19 | | - Contracts_Checks : Enabled_Kind := External ("STARTUP_GEN_CONTRACTS", "enabled"); |
20 | | - |
21 | | - type Build_Kind is ("debug", "optimize"); |
22 | | - Build_Mode : Build_Kind := External ("STARTUP_GEN_BUILD_MODE", "optimize"); |
23 | | - |
24 | | - Compile_Checks_Switches := (); |
25 | | - case Compile_Checks is |
26 | | - when "enabled" => |
27 | | - Compile_Checks_Switches := |
28 | | - ("-gnatwa", -- All warnings |
29 | | - "-gnatVa", -- All validity checks |
30 | | - "-gnatwe"); -- Warnings as errors |
31 | | - when others => null; |
32 | | - end case; |
33 | | - |
34 | | - Runtime_Checks_Switches := (); |
35 | | - case Runtime_Checks is |
36 | | - when "enabled" => null; |
37 | | - when others => |
38 | | - Runtime_Checks_Switches := |
39 | | - ("-gnatp"); -- Supress checks |
40 | | - end case; |
41 | | - |
42 | | - Style_Checks_Switches := (); |
43 | | - case Style_Checks is |
44 | | - when "enabled" => null; |
45 | | - Style_Checks_Switches := |
46 | | - ("-gnatyg", -- Style checks |
47 | | - "-gnatyM80", -- Maximum line length |
48 | | - "-gnatyO"); -- Overriding subprograms explicitly marked as such |
49 | | - when others => null; |
50 | | - end case; |
51 | | - |
52 | | - Contracts_Switches := (); |
53 | | - case Contracts_Checks is |
54 | | - when "enabled" => null; |
55 | | - Contracts_Switches := |
56 | | - ("-gnata"); -- Enable assertions and contracts |
57 | | - when others => |
58 | | - end case; |
59 | | - |
60 | | - Build_Switches := (); |
61 | | - case Build_Mode is |
62 | | - when "optimize" => |
63 | | - Build_Switches := ("-O3", -- Optimization |
64 | | - "-gnatn"); -- Enable inlining |
65 | | - when "debug" => |
66 | | - Build_Switches := ("-g", -- Debug info |
67 | | - "-O0"); -- No optimization |
68 | | - end case; |
| 7 | + for Exec_Dir use "bin"; |
| 8 | + for Main use ("startup_gen.adb"); |
69 | 9 |
|
70 | 10 | package Compiler is |
71 | | - for Default_Switches ("Ada") use |
72 | | - Compile_Checks_Switches & |
73 | | - Build_Switches & |
74 | | - Runtime_Checks_Switches & |
75 | | - Style_Checks_Switches & |
76 | | - Contracts_Switches & |
77 | | - ("-gnatQ"); -- Don't quit. Generate ALI and tree files even if illegalities |
| 11 | + for Default_Switches ("Ada") use Startup_Gen_Config.Ada_Compiler_Switches; |
78 | 12 | end Compiler; |
79 | 13 |
|
80 | | - package Builder is |
81 | | - for Executable ("main.adb") use "startup-gen"; |
82 | | - end Builder; |
| 14 | + package Binder is |
| 15 | + for Switches ("Ada") use ("-Es"); -- Symbolic traceback |
| 16 | + end Binder; |
83 | 17 |
|
84 | 18 | package Install is |
85 | 19 | for Artifacts (".") use ("share"); |
|
0 commit comments