From 349a34cb1ae1e37f791aaf44dc0a298aff4e1e78 Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Sun, 1 Jun 2025 13:37:26 +0200 Subject: [PATCH] Also delete .pdb unless -keep-executable is supplied --- src/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index dfc2f3213..b0f839509 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3889,6 +3889,14 @@ end_of_code_gen:; if (!build_context.keep_executable) { char const *filename = cast(char const *)exe_name.text; gb_file_remove(filename); + + if (build_context.metrics.os == TargetOs_windows && build_context.ODIN_DEBUG) { + String pdb_path = path_to_string(heap_allocator(), build_context.build_paths[BuildPath_PDB]); + defer (gb_free(heap_allocator(), pdb_path.text)); + + filename = cast(char const *)pdb_path.text; + gb_file_remove(filename); + } } } return 0;