Skip to content

Commit

Permalink
Merge branch 'topic/source_filter' into 'master'
Browse files Browse the repository at this point in the history
Add a source filter when using the "--no-subprojects" flag

Closes #347

See merge request eng/libadalang/langkit-query-language!296
  • Loading branch information
HugoGGuerrier committed Oct 11, 2024
2 parents c69cd14 + 51ea756 commit 2120ed5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lkql_checker/src/gnatcheck-projects.adb
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,12 @@ package body Gnatcheck.Projects is
------------------------------

procedure Get_Sources_From_Project (My_Project : in out Arg_Project_Type) is
use type GPR2.Language_Id;

function Only_Ada_Mains
(Prj : GPR2.Project.View.Object) return Boolean;
-- Returns whether the provided ``Prj`` project view defines only Ada
-- mains.

procedure Store_Source (Unit : GPR2.Build.Compilation_Unit.Object);
-- Callback used to store sources
Expand All @@ -234,7 +237,6 @@ package body Gnatcheck.Projects is
function Only_Ada_Mains
(Prj : GPR2.Project.View.Object) return Boolean
is
use type GPR2.Language_Id;
Src : GPR2.Build.Source.Object;
CU : GPR2.Build.Compilation_Unit.Unit_Location;

Expand Down Expand Up @@ -333,7 +335,10 @@ package body Gnatcheck.Projects is
end if;
else
for Src of Root.Sources loop
Store_Sources_To_Process (String (Src.Path_Name.Simple_Name));
if Src.Language = GPR2.Ada_Language then
Store_Sources_To_Process
(String (Src.Path_Name.Simple_Name));
end if;
end loop;
end if;
end if;
Expand Down

0 comments on commit 2120ed5

Please sign in to comment.