From 10286c0b22f3111e74bf699f224a4e8061626d4c Mon Sep 17 00:00:00 2001
From: Jedidiah Barber <contact@jedbarber.id.au>
Date: Sat, 5 Apr 2025 23:06:26 +1300
Subject: Initial commit

---
 proj/common.gpr | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 102 insertions(+)
 create mode 100644 proj/common.gpr

(limited to 'proj')

diff --git a/proj/common.gpr b/proj/common.gpr
new file mode 100644
index 0000000..d689556
--- /dev/null
+++ b/proj/common.gpr
@@ -0,0 +1,102 @@
+
+
+abstract project Common is
+
+
+    type Build_Kind is ("release", "debug");
+
+    Ver : Build_Kind := external ("build", "release");
+
+
+    package Builder is
+        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
+
+    C_Common :=
+       ("-Wall",
+        "-Werror",
+        "-Wextra",
+        "-Wpedantic");
+
+    package Compiler is
+        case Ver is
+
+        when "release" =>
+            for Default_Switches ("Ada") use Ada_Common & "-O3" & "-Os" & "-gnatn";
+            for Default_Switches ("C")   use C_Common   & "-O3" & "-Os";
+
+        when "debug" =>
+            for Default_Switches ("Ada") use Ada_Common & "-O0" & "-gnata" & "-gnato" & "-g";
+            for Default_Switches ("C")   use C_Common   & "-O0";
+
+        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") & "-E";
+
+        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 Common;
+
+
-- 
cgit