Project : Project_Node_Id);
-- Check that an aggregate project only imports abstract projects
+ procedure Check_Import_Aggregate
+ (Flags : Processing_Flags;
+ In_Tree : Project_Node_Tree_Ref;
+ Project : Project_Node_Id);
+ -- Check that a non aggregate project does not import any aggregate
+ -- project.
+
procedure Create_Virtual_Extending_Project
(For_Project : Project_Node_Id;
Main_Project : Project_Node_Id;
end if;
end Check_Aggregate_Imports;
+ ----------------------------
+ -- Check_Import_Aggregate --
+ ----------------------------
+
+ procedure Check_Import_Aggregate
+ (Flags : Processing_Flags;
+ In_Tree : Project_Node_Tree_Ref;
+ Project : Project_Node_Id)
+ is
+ With_Clause, Imported : Project_Node_Id;
+ begin
+ if Project_Qualifier_Of (Project, In_Tree) /= Aggregate then
+ With_Clause := First_With_Clause_Of (Project, In_Tree);
+
+ while Present (With_Clause) loop
+ Imported := Project_Node_Of (With_Clause, In_Tree);
+
+ if Project_Qualifier_Of (Imported, In_Tree) = Aggregate then
+ Error_Msg_Name_1 := Name_Id (Path_Name_Of (Imported, In_Tree));
+ Error_Msg (Flags, "cannot import aggregate project %%",
+ Token_Ptr);
+ exit;
+ end if;
+
+ With_Clause := Next_With_Clause_Of (With_Clause, In_Tree);
+ end loop;
+ end if;
+ end Check_Import_Aggregate;
+
----------------------------
-- Read_Project_Qualifier --
----------------------------
Check_Extending_All_Imports (Env.Flags, In_Tree, Project);
Check_Aggregate_Imports (Env.Flags, In_Tree, Project);
+ Check_Import_Aggregate (Env.Flags, In_Tree, Project);
-- Check that a project with a name including a dot either imports
-- or extends the project whose name precedes the last dot.
(thus reducing the number of system calls and contributing to faster
compilation times especially on systems with sources on remote
servers). As part of the loading, @command{gprbuild}
-computes how and where a source file should be compiled, and even if it is found
-several times in the aggregated projects it will be compiled only
+computes how and where a source file should be compiled, and even if it is
+found several times in the aggregated projects it will be compiled only
once.
Since there is no ambiguity as to which switches should be used, files
@code{project}.
An aggregate project cannot @code{with} any other project (standard or
-aggregate), except an abstract project which can be used to share
-attribute values. Building other aggregate projects from an aggregate
-project is done through the Project_Files attribute (see below).
+aggregate), except an abstract project which can be used to share attribute
+values. Also, aggregate projects cannot be extended or imported though a
+@code{with} clause by any other project. Building other aggregate projects from
+an aggregate project is done through the Project_Files attribute (see below).
An aggregate project does not have any source files directly (only
through other standard projects). Therefore a number of the standard
build all their source files (not just the ones needed by other
projects).
-The file can include paths (absolute or relative). Paths are
-relative to the location of the aggregate project file itself (if
-you use a base name, we expect to find the .gpr file in the same
-directory as the aggregate project file). The extension @file{.gpr} is
-mandatory, since this attribute contains file names, not project names.
+The file can include paths (absolute or relative). Paths are relative to
+the location of the aggregate project file itself (if you use a base name,
+we expect to find the .gpr file in the same directory as the aggregate
+project file). The environment variables @code{ADA_PROJECT_PATH},
+@code{GPR_PROJECT_PATH} and @code{GPR_PROJECT_PATH_FILE} are not used to find
+the project files. The extension @file{.gpr} is mandatory, since this attribute
+contains file names, not project names.
Paths can also include the @code{"*"} and @code{"**"} globbing patterns. The
latter indicates that any subdirectory (recursively) will be
The Project_Files attribute (See @pxref{Aggregate Projects}) is used to
described the aggregated projects whose object files have to be
-included into the aggregate library.
+included into the aggregate library. The environment variables
+@code{ADA_PROJECT_PATH}, @code{GPR_PROJECT_PATH} and
+@code{GPR_PROJECT_PATH_FILE} are not used to find the project files.
@c ---------------------------------------------
@node Project File Reference