[Ada] Allow the same library project in different project tree

Arnaud Charlet charlet@adacore.com
Thu Jul 12 10:37:00 GMT 2012


It is possible to have the same library project in different aggregated
projects, so in different project tree.

Tested on x86_64-pc-linux-gnu, committed on trunk

2012-07-12  Pascal Obry  <obry@adacore.com>

	* prj-nmsc.adb (Check_Library_Attributes): Allow the same library
	project in different project tree (different aggregated projects).

-------------- next part --------------
Index: prj-nmsc.adb
===================================================================
--- prj-nmsc.adb	(revision 189431)
+++ prj-nmsc.adb	(working copy)
@@ -165,6 +165,7 @@
    type Lib_Data is record
       Name : Name_Id;
       Proj : Project_Id;
+      Tree : Project_Tree_Ref;
    end record;
 
    package Lib_Data_Table is new GNAT.Table
@@ -3639,7 +3640,9 @@
          --  Check if the same library name is used in an other library project
 
          for J in 1 .. Lib_Data_Table.Last loop
-            if Lib_Data_Table.Table (J).Name = Project.Library_Name then
+            if Lib_Data_Table.Table (J).Name = Project.Library_Name
+              and then Lib_Data_Table.Table (J).Tree = Data.Tree
+            then
                Error_Msg_Name_1 := Lib_Data_Table.Table (J).Proj.Name;
                Error_Msg
                  (Data.Flags,
@@ -3656,7 +3659,9 @@
          --  Record the library name
 
          Lib_Data_Table.Append
-           ((Name => Project.Library_Name, Proj => Project));
+           ((Name => Project.Library_Name,
+             Proj => Project,
+             Tree => Data.Tree));
       end if;
    end Check_Library_Attributes;
 


More information about the Gcc-patches mailing list