From 85b4f256794699c9360d9aa54901ab2ceeddd8d5 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Tue, 19 Jan 2021 14:14:49 +1100 Subject: Project files now have optimized compile mode --- examples.gpr | 12 +++++++++++- packrat.gpr | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/examples.gpr b/examples.gpr index 2f63bc2..117886f 100644 --- a/examples.gpr +++ b/examples.gpr @@ -6,6 +6,11 @@ with "packrat"; project Examples is + type Mode_Type is ("debug", "release"); + + Mode : Mode_Type := external ("mode", "debug"); + + for Languages use ("Ada"); @@ -23,7 +28,12 @@ project Examples is package Compiler is - for Default_Switches ("Ada") use ("-gnaty4aAbcefhiklM100nprt"); + case Mode is + when "debug" => + for Switches ("Ada") use ("-gnaty4aAbcefhiklM100nprt"); + when "release" => + for Switches ("Ada") use ("-O3"); + end case; end Compiler; diff --git a/packrat.gpr b/packrat.gpr index c66f654..98dd071 100644 --- a/packrat.gpr +++ b/packrat.gpr @@ -6,6 +6,11 @@ with "directed_graph"; library project Packrat is + type Mode_Type is ("debug", "release"); + + Mode : Mode_Type := external ("mode", "debug"); + + for Languages use ("Ada"); @@ -17,7 +22,12 @@ library project Packrat is package Compiler is - for Default_Switches("Ada") use ("-gnaty4aAbcefhiklM100nprt"); + case Mode is + when "debug" => + for Switches ("Ada") use ("-gnaty4aAbcefhiklM100nprt"); + when "release" => + for Switches ("Ada") use ("-O3"); + end case; end Compiler; -- cgit