|
| 1 | +-- Copyright ©2023 Steve Merrony |
| 2 | +-- |
| 3 | +-- Keypadder is free software: you can redistribute it and/or modify |
| 4 | +-- it under the terms of the GNU General Public License as published by |
| 5 | +-- the Free Software Foundation, either version 3 of the License, or |
| 6 | +-- (at your option) any later version. |
| 7 | +-- |
| 8 | +-- Keypadder is distributed in the hope that it will be useful, |
| 9 | +-- but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | +-- GNU General Public License for more details. |
| 12 | +-- |
| 13 | +-- You should have received a copy of the GNU General Public License |
| 14 | +-- along with Keypadder. If not, see <https://www.gnu.org/licenses/>. |
| 15 | + |
| 16 | +with "ada_toml.gpr"; -- installed locally |
| 17 | +with "aws"; -- installed via system package manager |
| 18 | + |
| 19 | +project Keypadder is |
| 20 | + type Mode_Type is ("debug", "release"); -- all possible values |
| 21 | + Mode : Mode_Type := external ("mode", "debug"); -- default |
| 22 | + |
| 23 | + for Languages use ("Ada"); |
| 24 | + for Main use ("keypadder.adb"); |
| 25 | + for Source_Dirs use ("src"); |
| 26 | + for Object_Dir use "obj"; |
| 27 | + for Exec_Dir use "./"; |
| 28 | + |
| 29 | + package Compiler is |
| 30 | + case Mode is |
| 31 | + when "debug" => |
| 32 | + for Switches ("Ada") use ( "-fstack-check", |
| 33 | + "-g", |
| 34 | + "-gnata", |
| 35 | + "-gnateE", |
| 36 | + "-gnatwa", |
| 37 | + "-O0" |
| 38 | + ); |
| 39 | + |
| 40 | + when "release" => |
| 41 | + for Switches ("Ada") use ("-flto", "-O3"); |
| 42 | + end case; |
| 43 | + end Compiler; |
| 44 | + |
| 45 | + package Binder is |
| 46 | + case Mode is |
| 47 | + when "debug" => |
| 48 | + for Switches ("Ada") use ("-Es"); |
| 49 | + when "release" => |
| 50 | + for Switches ("Ada") use ("-Es"); |
| 51 | + end case; |
| 52 | + end Binder; |
| 53 | + |
| 54 | + -- package Builder is |
| 55 | + -- for Global_Configuration_Pragmas use "gnat.adc"; |
| 56 | + -- end Builder; |
| 57 | + |
| 58 | + package Linker is |
| 59 | + case Mode is |
| 60 | + when "debug" => |
| 61 | + for Switches ("Ada") use ("-g"); |
| 62 | + when "release" => |
| 63 | + for Switches ("Ada") use ("-flto", "-O3"); |
| 64 | + end case; |
| 65 | + end Linker; |
| 66 | + |
| 67 | +end Keypadder; |
0 commit comments