File: shared.gpr.in

package info (click to toggle)
libgtkada 21.0.0.785f3cf4-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 41,160 kB
  • sloc: ada: 203,114; xml: 8,403; python: 4,501; perl: 3,838; ansic: 2,949; sh: 2,851; makefile: 351; objc: 160; javascript: 100
file content (119 lines) | stat: -rw-r--r-- 4,916 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
------------------------------------------------------------------------------
--               GtkAda - Ada95 binding for the Gimp Toolkit                --
--                                                                          --
--                      Copyright (C) 2015, AdaCore                         --
--                                                                          --
-- This library is free software;  you can redistribute it and/or modify it --
-- under terms of the  GNU General Public License  as published by the Free --
-- Software  Foundation;  either version 3,  or (at your  option) any later --
-- version. This library is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- --
-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            --
--                                                                          --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception,   --
-- version 3.1, as published by the Free Software Foundation.               --
--                                                                          --
-- You should have received a copy of the GNU General Public License and    --
-- a copy of the GCC Runtime Library Exception along with this program;     --
-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
-- <http://www.gnu.org/licenses/>.                                          --
--                                                                          --
------------------------------------------------------------------------------

with "gtk";

project Shared is

   type Build_Type is ("Debug", "Production");
   Build : Build_Type := external ("BUILD", "@BUILD_TYPE@");

   type Boolean_Type is ("True", "False");
   Build_Opengl : Boolean_Type := "@HAVE_OPENGL@";

   type Yes_No is ("yes", "no");
   Need_Objective_C : Yes_No := "@NEED_OBJECTIVE_C@";

   for Source_Files use ();

   type Library_Kinds is ("relocatable", "static", "static-pic");
   Library_Kind : Library_Kinds := external ("LIBRARY_TYPE", "@DEFAULT_LIBRARY_TYPE@");

   type So_Ext_Type is (".so", ".sl", ".dll", ".dylib");
   So_Ext      : So_Ext_Type := "@SO_EXT@";

   Version     := "@PACKAGE_VERSION@";
   Gtk_Include := Gtk.Gtk_Default_Include & (@GTK_CFLAGS_GPR@);
   Gtk_Libs    := Gtk.Gtk_Default_Libs    & (@GTK_LIBS_GPR@);
   GL_Include  := Gtk.GL_Default_Include  & (@GL_CFLAGS_GPR@);
   GL_Libs     := Gtk.GL_Default_Libs     & (@GL_LIBS_GPR@);

   Adaflags    := External_As_List ("ADAFLAGS", " ");
   Cflags      := External_As_List ("CFLAGS", " ");
   Cppflags    := External_As_List ("CPPFLAGS", " ");
   Ldflags     := External_As_List ("LDFLAGS", " ");
   Objcflags   := External_As_List ("OBJCFLAGS", " ");

   package Naming is
      for Body_Suffix ("Objective-C") use ".m";
   end Naming;

   package Compiler is
      for Driver ("Objective-C") use "@OBJC@";
      for Leading_Required_Switches ("Objective-C") use ("-c");
      for PIC_Option ("Objective-C") use ("-fPIC");
      for PIC_Option ("C") use ("-fPIC");

      case Build is
         when "Debug" =>
             for Switches ("Ada") use
                ("-gnatQ", "-gnatwae", "-gnatay", "-g", "-O0");
             for Switches ("C") use ("-g", "-O0", "-Wformat", "-Werror=format-security");
         when "Production" =>
             for Switches ("Ada") use
                ("-gnatQ", "-O2", "-gnatn", "-gnatwa", "-gnaty");
             for Switches ("C") use ("-O2", "-Wformat", "-Werror=format-security");
      end case;

      for Switches ("C") use Compiler'Switches ("C") & Gtk_Include;
      for Switches ("Objective-C") use Compiler'Switches ("Objective-C") & Gtk_Include;

      for Switches ("Ada") use Compiler'Switches ("Ada") & Adaflags;
      for Switches ("C") use Compiler'Switches ("C") & Cflags & Cppflags;
      for Switches ("Objective-C") use Compiler'Switches ("Objective-C")
        & Objcflags & Cppflags;
   end Compiler;

   package Builder is
      for Switches ("Ada") use ("-m");

      case Build is
         when "Debug" =>
            for Global_Configuration_Pragmas use Shared'Project_Dir & "src/gnat_debug.adc";
         when "Production" =>
            for Global_Configuration_Pragmas use Shared'Project_Dir & "src/gnat.adc";
      end case;
   end Builder;

   package Binder is
      case Build is
         when "Debug" =>
             for Default_Switches ("Ada") use ("-E");
         when "Production" =>
             null;
      end case;
   end Binder;

   package Linker is
      for Leading_Switches ("Ada") use Ldflags;
   end Linker;

   package IDE is
      for VCS_Kind use "auto";
   end IDE;

   package Documentation is
      for Documentation_Dir use "html";
   end Documentation;

end Shared;