public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] gnatmake fails with incorrect default config project file
@ 2011-08-02 10:36 Arnaud Charlet
  0 siblings, 0 replies; only message in thread
From: Arnaud Charlet @ 2011-08-02 10:36 UTC (permalink / raw)
  To: gcc-patches; +Cc: Vincent Celier

[-- Attachment #1: Type: text/plain, Size: 761 bytes --]

When a default config project file (for example default.cgpr in
.../share/gpr) exists, gnatmake was parsing it, and would fail if, for
example, Default_Language was not declared.
This patch ensures that an existing config project file is never taken
into account by gnatmake.
The test is to invoke gnatmake with an empty config project file
default.cgpr in the project directory: gnatmake should not fail because
of the presence of this empty config project file.

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

2011-08-02  Vincent Celier  <celier@adacore.com>

	* prj-conf.adb (Get_Or_Create_Configuration_File): If On_Load_Config is
	not null, call it to create the in memory config project file without
	parsing an existing default config project file.


[-- Attachment #2: difs --]
[-- Type: text/plain, Size: 1251 bytes --]

Index: prj-conf.adb
===================================================================
--- prj-conf.adb	(revision 177054)
+++ prj-conf.adb	(working copy)
@@ -1107,7 +1107,12 @@
          Write_Line (Config_File_Path.all);
       end if;
 
-      if Config_File_Path /= null then
+      if On_Load_Config /= null then
+         On_Load_Config
+           (Config_File       => Config_Project_Node,
+            Project_Node_Tree => Project_Node_Tree);
+
+      elsif Config_File_Path /= null then
          Prj.Part.Parse
            (In_Tree                => Project_Node_Tree,
             Project                => Config_Project_Node,
@@ -1119,16 +1124,9 @@
             Flags                  => Flags,
             Target_Name            => Target_Name);
       else
-         --  Maybe the user will want to create his own configuration file
          Config_Project_Node := Empty_Node;
       end if;
 
-      if On_Load_Config /= null then
-         On_Load_Config
-           (Config_File       => Config_Project_Node,
-            Project_Node_Tree => Project_Node_Tree);
-      end if;
-
       if Config_Project_Node /= Empty_Node then
          Prj.Proc.Process_Project_Tree_Phase_1
            (In_Tree                => Project_Tree,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-02 10:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-02 10:36 [Ada] gnatmake fails with incorrect default config project file Arnaud Charlet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).