Skip to content

Commit 2120ed5

Browse files
committed
Merge branch 'topic/source_filter' into 'master'
Add a source filter when using the "--no-subprojects" flag Closes #347 See merge request eng/libadalang/langkit-query-language!296
2 parents c69cd14 + 51ea756 commit 2120ed5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lkql_checker/src/gnatcheck-projects.adb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,12 @@ package body Gnatcheck.Projects is
220220
------------------------------
221221

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

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

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

@@ -333,7 +335,10 @@ package body Gnatcheck.Projects is
333335
end if;
334336
else
335337
for Src of Root.Sources loop
336-
Store_Sources_To_Process (String (Src.Path_Name.Simple_Name));
338+
if Src.Language = GPR2.Ada_Language then
339+
Store_Sources_To_Process
340+
(String (Src.Path_Name.Simple_Name));
341+
end if;
337342
end loop;
338343
end if;
339344
end if;

0 commit comments

Comments
 (0)