For qualified library project, when attribute Library_Name was not
declared, but attribute Library_Dir was, both attributes were reported
as not declared.
The test for this is to have a qualified library project with Library_Dir
declared and Library_Name not declared. There should be no error message
for Library_Dir not declared.
Tested on x86_64-pc-linux-gnu, committed on trunk
2011-08-02 Vincent Celier <[email protected]>
* prj-nmsc.adb (Check_Library_Attributes): Do not report Library_Dir
not declared for qualified library project when Library_Name is not
declared, but Library_Dir is.
Index: prj-nmsc.adb
===================================================================
--- prj-nmsc.adb (revision 177107)
+++ prj-nmsc.adb (working copy)
@@ -3915,17 +3915,23 @@
when Library =>
if not Project.Library then
- if Project.Library_Dir = No_Path_Information then
+ if Project.Library_Name = No_Name then
Error_Msg
(Data.Flags,
- "\attribute Library_Dir not declared",
+ "attribute Library_Name not declared",
Project.Location, Project);
- end if;
- if Project.Library_Name = No_Name then
+ if not Library_Directory_Present then
+ Error_Msg
+ (Data.Flags,
+ "\attribute Library_Dir not declared",
+ Project.Location, Project);
+ end if;
+
+ elsif Project.Library_Dir = No_Path_Information then
Error_Msg
(Data.Flags,
- "\attribute Library_Name not declared",
+ "attribute Library_Dir not declared",
Project.Location, Project);
end if;
end if;