Skip to content

Commit b03e3c7

Browse files
authored
Update copyndk.py
1 parent b2f40dc commit b03e3c7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

copyndk.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,30 @@ def copy_file(source_file_path, target_file_path):
4646
shutil.copy2(source_file_path, target_file_path)
4747
print(f"Copied file {source_file_path} to {target_file_path}")
4848

49+
def delete_pdb_files(directory):
50+
"""
51+
Delete all .pdb files in the specified directory and its subdirectories.
52+
53+
Args:
54+
- directory: The path to the directory where the search should begin.
55+
"""
56+
for root, dirs, files in os.walk(directory):
57+
for file in files:
58+
if file.endswith(".pdb"):
59+
file_path = os.path.join(root, file)
60+
os.remove(file_path)
61+
print(f"Deleted {file_path}")
62+
4963
if __name__ == "__main__":
5064
if len(sys.argv) != 3:
5165
print("Usage: python copy_files.py <source_directory> <target_directory>")
5266
else:
5367
source_directory = sys.argv[1]
5468
target_directory = sys.argv[2]
5569
copy_files_and_dirs(source_directory + "/bin", target_directory + "/bin")
70+
delete_pdb_files(target_directory + "/bin")
5671
copy_file(source_directory + "/bin/lld.exe", target_directory + "/bin/ld.exe")
72+
copy_file(source_directory + "/bin/clang.pdb", target_directory + "/bin/clang.pdb")
73+
copy_file(source_directory + "/bin/lld.pdb", target_directory + "/bin/lld.pdb")
5774
copy_files_and_dirs(source_directory + "/lib/clang", target_directory + "/lib/clang")
75+

0 commit comments

Comments
 (0)