|
| 1 | +abstract project Config is |
| 2 | + for Source_Dirs use (); |
| 3 | + |
| 4 | + type Yes_No is ("yes", "no"); |
| 5 | + |
| 6 | + type Library_Type_Type is ("relocatable", "static", "static-pic"); |
| 7 | + |
| 8 | + type Build_Type is ("distrib", "debug", "optimize", "profile", "coverage"); |
| 9 | + Mode : Build_Type := external ("BUILD", "debug"); |
| 10 | + |
| 11 | + Processors := External ("PROCESSORS", "1"); |
| 12 | + |
| 13 | + package Builder is |
| 14 | + for Default_Switches ("Ada") use ("-j" & Processors); |
| 15 | + end Builder; |
| 16 | + |
| 17 | + package compiler is |
| 18 | + warnings := ("-gnatwua"); |
| 19 | + defaults := ("-gnat2012"); |
| 20 | + case Mode is |
| 21 | + when "distrib" => |
| 22 | + for Default_Switches ("Ada") use defaults & ("-O2", "-gnatafno", "-gnatVa", "-gnatwa"); |
| 23 | + |
| 24 | + when "debug" => |
| 25 | + for Default_Switches ("Ada") use defaults & warnings |
| 26 | + & ("-g", "-gnata", "-gnatVaMI", "-gnaty3abcefhiklmnprstxM127"); |
| 27 | + |
| 28 | + when "coverage" => |
| 29 | + for Default_Switches ("Ada") use defaults & warnings |
| 30 | + & ("-g", "-O2", "-gnata", "-gnatVaMI", "-gnaty3abcefhiklmnprstxM127", |
| 31 | + "-fprofile-arcs", "-ftest-coverage"); |
| 32 | + |
| 33 | + when "optimize" => |
| 34 | + for Default_Switches ("Ada") use defaults & warnings |
| 35 | + & ("-O2", "-gnatn", "-gnatp", "-fdata-sections", "-ffunction-sections"); |
| 36 | + |
| 37 | + when "profile" => |
| 38 | + for Default_Switches ("Ada") use defaults & warnings & ("-pg"); |
| 39 | + |
| 40 | + end case; |
| 41 | + end compiler; |
| 42 | + |
| 43 | + package binder is |
| 44 | + case Mode is |
| 45 | + when "debug" => |
| 46 | + for Default_Switches ("Ada") use ("-E"); |
| 47 | + |
| 48 | + when others => |
| 49 | + for Default_Switches ("Ada") use ("-E"); |
| 50 | + |
| 51 | + end case; |
| 52 | + end binder; |
| 53 | + |
| 54 | + package linker is |
| 55 | + case Mode is |
| 56 | + when "profile" => |
| 57 | + for Default_Switches ("Ada") use ("-pg"); |
| 58 | + |
| 59 | + when "distrib" => |
| 60 | + for Default_Switches ("Ada") use ("-s"); |
| 61 | + |
| 62 | + when "optimize" => |
| 63 | + for Default_Switches ("Ada") use ("-Wl,--gc-sections"); |
| 64 | + |
| 65 | + when "coverage" => |
| 66 | + for Default_Switches ("ada") use ("-fprofile-arcs"); |
| 67 | + |
| 68 | + when others => |
| 69 | + null; |
| 70 | + end case; |
| 71 | + |
| 72 | + end linker; |
| 73 | + |
| 74 | + package Ide is |
| 75 | + for VCS_Kind use "git"; |
| 76 | + end Ide; |
| 77 | + |
| 78 | +end Config; |
0 commit comments