prj-conf.adb (Get_Or_Create_Configuration_File): Do not attempt to find a configuration project file when...
2014-01-23 Vincent Celier <celier@adacore.com> * prj-conf.adb (Get_Or_Create_Configuration_File): Do not attempt to find a configuration project file when Config_File_Name is No_Configuration_File. * prj-conf.ads (No_Configuration_File): New constant String. * prj-pars.adb (Parse): Call Get_Or_Create_Configuration_File with Config_File_Name set to No_Configuration_File, so that no existing configuration project file will be used, and the configuration project will be only created in memory when Add_Default_GNAT_Naming_Scheme is called. * projects.texi: Minor reformatting. From-SVN: r206985
This commit is contained in:
parent
225a0c5c56
commit
cc55f9bee5
@ -1,3 +1,16 @@
|
||||
2014-01-23 Vincent Celier <celier@adacore.com>
|
||||
|
||||
* prj-conf.adb (Get_Or_Create_Configuration_File): Do not attempt
|
||||
to find a configuration project file when Config_File_Name is
|
||||
No_Configuration_File.
|
||||
* prj-conf.ads (No_Configuration_File): New constant String.
|
||||
* prj-pars.adb (Parse): Call Get_Or_Create_Configuration_File
|
||||
with Config_File_Name set to No_Configuration_File, so that
|
||||
no existing configuration project file will be used, and the
|
||||
configuration project will be only created in memory when
|
||||
Add_Default_GNAT_Naming_Scheme is called.
|
||||
* projects.texi: Minor reformatting.
|
||||
|
||||
2014-01-23 Vincent Celier <celier@adacore.com>
|
||||
|
||||
* prj-conf.adb (Get_Or_Create_Configuration_File): Never parse
|
||||
|
@ -1372,19 +1372,27 @@ package body Prj.Conf is
|
||||
Get_Project_Target;
|
||||
Check_Builder_Switches;
|
||||
|
||||
if Conf_File_Name'Length > 0 then
|
||||
Config_File_Path := Locate_Config_File (Conf_File_Name.all);
|
||||
else
|
||||
Config_File_Path := Locate_Config_File (Default_File_Name);
|
||||
end if;
|
||||
-- Do not attempt to find a configuration project file when
|
||||
-- Config_File_Name is No_Configuration_File.
|
||||
|
||||
if Config_File_Path = null then
|
||||
if not Allow_Automatic_Generation
|
||||
and then Conf_File_Name'Length > 0
|
||||
then
|
||||
Raise_Invalid_Config
|
||||
("could not locate main configuration project "
|
||||
& Conf_File_Name.all);
|
||||
if Config_File_Name = No_Configuration_File then
|
||||
Config_File_Path := null;
|
||||
|
||||
else
|
||||
if Conf_File_Name'Length > 0 then
|
||||
Config_File_Path := Locate_Config_File (Conf_File_Name.all);
|
||||
else
|
||||
Config_File_Path := Locate_Config_File (Default_File_Name);
|
||||
end if;
|
||||
|
||||
if Config_File_Path = null then
|
||||
if not Allow_Automatic_Generation
|
||||
and then Conf_File_Name'Length > 0
|
||||
then
|
||||
Raise_Invalid_Config
|
||||
("could not locate main configuration project "
|
||||
& Conf_File_Name.all);
|
||||
end if;
|
||||
end if;
|
||||
end if;
|
||||
|
||||
@ -1415,22 +1423,18 @@ package body Prj.Conf is
|
||||
and then On_Load_Config = null
|
||||
then
|
||||
Write_Line
|
||||
("warning: --RTS is taken into account only in auto-configuration");
|
||||
("warning: " &
|
||||
"--RTS is taken into account only in auto-configuration");
|
||||
end if;
|
||||
|
||||
-- Parse the configuration file
|
||||
|
||||
if Verbose_Mode
|
||||
and then Config_File_Path /= null
|
||||
and then On_Load_Config = null
|
||||
then
|
||||
if Verbose_Mode and then Config_File_Path /= null then
|
||||
Write_Str ("Checking configuration ");
|
||||
Write_Line (Config_File_Path.all);
|
||||
end if;
|
||||
|
||||
-- Add comment for On_Load_Config test ???
|
||||
|
||||
if Config_File_Path /= null and then On_Load_Config = null then
|
||||
if Config_File_Path /= null then
|
||||
Prj.Part.Parse
|
||||
(In_Tree => Project_Node_Tree,
|
||||
Project => Config_Project_Node,
|
||||
|
@ -40,6 +40,12 @@ package Prj.Conf is
|
||||
-- is set to Empty_Node when this procedure is called. You can then decide
|
||||
-- to create a new config file if you need.
|
||||
|
||||
No_Configuration_File : constant String := "/";
|
||||
-- When specified as a parameter Config_File_Name in the procedures below,
|
||||
-- no existing configuration project file is parsed. This is used by
|
||||
-- gnatmake, gnatclean and the GNAT driver to avoid parsing an existing
|
||||
-- default configuration project file.
|
||||
|
||||
procedure Parse_Project_And_Apply_Config
|
||||
(Main_Project : out Prj.Project_Id;
|
||||
User_Project_Node : out Prj.Tree.Project_Node_Id;
|
||||
@ -68,6 +74,10 @@ package Prj.Conf is
|
||||
-- happened while parsing the project itself (i.e. creating the tree),
|
||||
-- User_Project_Node is also set to Empty_Node.
|
||||
--
|
||||
-- If Config_File_Name is No_Configuration_File, then no configuration
|
||||
-- project file is parsed. Normally, in this case On_Load_Config is not
|
||||
-- null, and it is used to create a configuration project file in memory.
|
||||
--
|
||||
-- Autoconf_Specified indicates whether the user has specified --autoconf.
|
||||
-- If this is the case, the config file might be (re)generated, as
|
||||
-- appropriate, to match languages and target if the one specified doesn't
|
||||
|
@ -86,7 +86,7 @@ package body Prj.Pars is
|
||||
Process_Project_And_Apply_Config
|
||||
(Main_Project => The_Project,
|
||||
User_Project_Node => Project_Node,
|
||||
Config_File_Name => "",
|
||||
Config_File_Name => No_Configuration_File,
|
||||
Autoconf_Specified => False,
|
||||
Project_Tree => In_Tree,
|
||||
Project_Node_Tree => Project_Node_Tree,
|
||||
|
@ -4384,11 +4384,11 @@ Index is a language name. Indicates the kind of the language, either file based
|
||||
or unit based. Only authorized case-insensitive values are "unit_based" and
|
||||
"file_based" (the default).
|
||||
|
||||
@item @b{Dependency_Kind}: : single, indexed, case-insensitive index
|
||||
@item @b{Dependency_Kind}: single, indexed, case-insensitive index
|
||||
|
||||
Index is a language name. Indicates how the dependencies are handled for the
|
||||
language. Only authorized case-insensitive values are "makefile", "ali_file",
|
||||
"ali_closure" or "none" (the default.
|
||||
"ali_closure" or "none" (the default).
|
||||
|
||||
@item @b{Required_Switches}: list, indexed, case-insensitive index
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user