Skip to content

Commit 3893436

Browse files
committed
Do not clean object directories with --save-temps
We generate some temporary files for instrumentation purposes in the instrumentation directory, which is cleaned by Instrument.Clean_Objdirs. As temporary files should be preserved when `--save-temps` is passed through the command line, avoid cleaning it altogether.
1 parent 3369b70 commit 3893436

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tools/gnatcov/instrument-clean_objdirs.adb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ with Ada.Directories; use Ada.Directories;
2020

2121
with GNATCOLL.Projects; use GNATCOLL.Projects;
2222

23+
with Command_Line; use Command_Line;
2324
with Instrument.Common; use Instrument.Common;
2425
with Project;
2526

@@ -62,9 +63,11 @@ begin
6263
-- through extended projects, as their object directories can interfere
6364
-- with the build of the extending project.
6465

65-
Project.Iterate_Projects
66-
(Root_Project => Project.Project.Root_Project,
67-
Process => Clean_Subdir'Access,
68-
Recursive => True,
69-
Include_Extended => True);
66+
if not Args.Bool_Args (Opt_Save_Temps) then
67+
Project.Iterate_Projects
68+
(Root_Project => Project.Project.Root_Project,
69+
Process => Clean_Subdir'Access,
70+
Recursive => True,
71+
Include_Extended => True);
72+
end if;
7073
end Instrument.Clean_Objdirs;

0 commit comments

Comments
 (0)