diff options
| author | Jedidiah Barber <contact@jedbarber.id.au> | 2025-05-10 16:56:27 +1200 | 
|---|---|---|
| committer | Jedidiah Barber <contact@jedbarber.id.au> | 2025-05-10 16:56:27 +1200 | 
| commit | 88629c7ed790c32911e8bd5f9b37792cb52aeac7 (patch) | |
| tree | 85713dbb2360f337f03a7141de0d4086ab9923ea | |
| parent | 08943d554ebbf75256ef737d3192289a1a7dc271 (diff) | |
Improved project file with debug info and optimisation
| -rw-r--r-- | fluid.gpr | 81 | 
1 files changed, 77 insertions, 4 deletions
@@ -1,20 +1,93 @@ +  project Fluid is +      for Languages use ("Ada"); -    for Source_Dirs use ("src/**"); -    for Object_Dir use "obj"; -    for Exec_Dir use "bin"; +    for Source_Dirs use ("src"); +    for Object_Dir  use "obj"; +    for Exec_Dir    use "bin"; +      for Main use ("fluid_simulator.adb"); + +    type Build_Kind is ("release", "debug"); + +    Ver : Build_Kind := external ("build", "release"); + +      package Builder is          for Executable ("fluid_simulator.adb") use "fluid"; + +        for Default_Switches ("Ada") use ("-j4", "-m"); +        for Global_Compilation_Switches ("Ada") use ("-shared"); + +        case Ver is +        when "release" => +            null; +        when "debug" => +            for Default_Switches ("Ada") use Builder'Default_Switches ("Ada") & "-g"; +        end case;      end Builder; + +    Ada_Common := +       ("-gnaty" +        & "4"     --  indentation +        & "a"     --  attribute casing +        & "A"     --  array attribute indices +        & "b"     --  blanks at end of lines +        & "c"     --  two space comments +        & "e"     --  end/exit labels +        & "f"     --  no form feeds or vertical tabs +        & "h"     --  no horizontal tabs +        & "i"     --  if/then layout +        & "k"     --  keyword casing +        & "l"     --  reference manual layout +        & "M100"  --  max line length +        & "n"     --  package Standard casing +        & "p"     --  pragma casing +        & "r"     --  identifier casing +        & "t",    --  token separation +        "-gnatw" +        & "a"     --  various warning modes +        & "F"     --  don't check for unreferenced formal parameters +        & "J"     --  don't check for obsolescent feature use +        & "U");   --  don't check for unused entities +      package Compiler is -        for Default_Switches("Ada") use ("-gnaty4aAbcefhiklM100nprt"); +        case Ver is +        when "release" => +            for Default_Switches ("Ada") use Ada_Common & "-O3" & "-gnatn"; +        when "debug" => +            for Default_Switches ("Ada") use Ada_Common & "-O0" & "-gnata" & "-gnato" & "-g"; +        end case;      end Compiler; + +    package Binder is +        for Default_Switches ("Ada") use ("-shared"); + +        case Ver is +        when "release" => +            null; +        when "debug" => +            for Default_Switches ("Ada") use Binder'Default_Switches ("Ada") & "-Es"; +        end case; +    end Binder; + + +    package Linker is +        case Ver is +        when "release" => +            null; +        when "debug" => +            for Default_Switches ("Ada") use ("-g"); +        end case; +    end Linker; + +  end Fluid; +  | 
