Commit 422ba273 by Vincent Celier Committed by Arnaud Charlet

gnatcmd.adb (GNATCmd): Do not issue -d= switch to gnatmetric when object…

gnatcmd.adb (GNATCmd): Do not issue -d= switch to gnatmetric when object directory of main project...

2007-12-06  Vincent Celier  <celier@adacore.com>

	* gnatcmd.adb (GNATCmd): Do not issue -d= switch to gnatmetric when
	object directory of main project does not exist.
	On VMS, correctly set then environment variable for the source
	directories.

From-SVN: r130841
parent 7b76e805
...@@ -2228,10 +2228,14 @@ begin ...@@ -2228,10 +2228,14 @@ begin
-- For gnatmetric, the generated files should be put in the object -- For gnatmetric, the generated files should be put in the object
-- directory. This must be the first switch, because it may be -- directory. This must be the first switch, because it may be
-- overriden by a switch in package Metrics in the project file or by -- overriden by a switch in package Metrics in the project file or
-- a command line option. -- by a command line option. Note that we don't add the -d= switch
-- if there is no object directory available.
if The_Command = Metric then if The_Command = Metric
and then
Project_Tree.Projects.Table (Project).Object_Directory /= No_Path
then
First_Switches.Increment_Last; First_Switches.Increment_Last;
First_Switches.Table (2 .. First_Switches.Last) := First_Switches.Table (2 .. First_Switches.Last) :=
First_Switches.Table (1 .. First_Switches.Last - 1); First_Switches.Table (1 .. First_Switches.Last - 1);
...@@ -2297,15 +2301,18 @@ begin ...@@ -2297,15 +2301,18 @@ begin
if ASIS_Main /= null then if ASIS_Main /= null then
Get_Closure; Get_Closure;
-- On VMS, set up again the env var for source dirs file. This is -- On VMS, set up the env var again for source dirs file. This is
-- because the call to gnatmake has set this env var to another -- because the call to gnatmake has set this env var to another
-- file that has now been deleted. -- file that has now been deleted.
if Hostparm.OpenVMS then if Hostparm.OpenVMS then
Setenv
(Project_Include_Path_File, -- First make sure that the recorded file names are empty
Prj.Env.Ada_Include_Path
(Project, Project_Tree, Recursive => True)); Prj.Env.Initialize;
Prj.Env.Set_Ada_Paths
(Project, Project_Tree, Including_Libraries => False);
end if; end if;
-- For gnat check, gnat pretty, gnat metric, gnat list, and gnat -- For gnat check, gnat pretty, gnat metric, gnat list, and gnat
...@@ -2313,10 +2320,10 @@ begin ...@@ -2313,10 +2320,10 @@ begin
-- with all the sources of the main project. -- with all the sources of the main project.
elsif The_Command = Check or else elsif The_Command = Check or else
The_Command = Pretty or else The_Command = Pretty or else
The_Command = Metric or else The_Command = Metric or else
The_Command = List or else The_Command = List or else
The_Command = Stack The_Command = Stack
then then
Check_Files; Check_Files;
end if; end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment