Skip to content

Commit 95e5e4c

Browse files
committed
refactor(parser): 移除多余的包含路径目录存在性检查
移除了在解析 Keil 项目文件时,对每个包含路径目录是否存在进行的检查。 此检查是多余的,因为后续处理会正确处理不存在的路径。
1 parent c6156d0 commit 95e5e4c

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

main.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ def parse_keil_project(file_path):
5454
rel_inc_path = os.path.relpath(abs_inc_path, output_dir)
5555
# 确保路径分隔符是 '/'
5656
rel_inc_path = rel_inc_path.replace("\\", "/")
57-
# 检查目录是否存在
58-
if os.path.isdir(abs_inc_path):
59-
includes.append(f"-I{rel_inc_path}")
60-
else:
61-
# TODO:可以选择打印警告或记录日志
62-
print(f"Warning: Include path directory does not exist, skipped: {abs_inc_path}")
6357

6458
# 提取源文件路径
6559
groups = target.findall('.//Group')

0 commit comments

Comments
 (0)