Skip to content

Commit

Permalink
Merge branch 'add_config_switch' into 'master'
Browse files Browse the repository at this point in the history
Add --config switch to gnatcheck

See merge request eng/libadalang/langkit-query-language!142
  • Loading branch information
fedor-rybin committed Nov 22, 2023
2 parents 5d2db9e + bcd1b69 commit 7e2bdb9
Show file tree
Hide file tree
Showing 5 changed files with 269 additions and 93 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ testsuite/ada_projects/*/*.ad[bs] no-precommit-check
# No needs
*.java no-precommit-check

*.png -text
19 changes: 13 additions & 6 deletions lkql_checker/lalcheck/gnatcheck-compiler.adb
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,7 @@ package body Gnatcheck.Compiler is
Split_Command : constant Slice_Set := Create (Worker_Command, " ");
Worker : String_Access := null;
Prj : constant String := Gnatcheck_Prj.Source_Prj;
CGPR : constant String := Gnatcheck_Prj.Source_CGPR;
Args : Argument_List (1 .. 128);
Num_Args : Integer := 0;

Expand Down Expand Up @@ -1441,14 +1442,20 @@ package body Gnatcheck.Compiler is
Args (Num_Args) := new String'(Get_Aggregated_Project);
end if;

if RTS_Path.all /= "" then
Num_Args := @ + 1;
Args (Num_Args) := new String'("--RTS=" & RTS_Path.all);
end if;
if CGPR = "" then
if RTS_Path.all /= "" then
Num_Args := @ + 1;
Args (Num_Args) := new String'("--RTS=" & RTS_Path.all);
end if;

if Target.all /= "" then
if Target.all /= "" then
Num_Args := @ + 1;
Args (Num_Args) := new String'("--target=" & Target.all);
end if;
else
-- Target and runtime will be taken from config project anyway
Num_Args := @ + 1;
Args (Num_Args) := new String'("--target=" & Target.all);
Args (Num_Args) := new String'("--config=" & CGPR);
end if;

if Debug_Mode then
Expand Down
1 change: 1 addition & 0 deletions lkql_checker/lalcheck/gnatcheck-output.adb
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ package body Gnatcheck.Output is
Info (" --ignore-project-switches - ignore switches specified in the project file");
Info (" --target=targetname - specify a target for cross platforms");
Info (" --RTS=<runtime> - use runtime <runtime>");
Info (" --config=<cgpr> - use configuration project <cgpr>");
Info ("");
Info (" -h - print out the list of the currently implemented rules");
Info (" -mn - n is the maximal number of diagnoses in Stderr");
Expand Down
Loading

0 comments on commit 7e2bdb9

Please sign in to comment.