From e8a54937d543b80b2fa2afdeda39a0c4febdeeca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=92=99=E8=92=99plus?= Date: Tue, 30 Dec 2025 17:26:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=8D=A2=E5=8E=BB=E9=87=8D?= =?UTF-8?q?=E7=AE=97=E6=B3=95=EF=BC=8C=E4=BF=9D=E8=AF=81=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E4=B8=80=E8=87=B4=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 便于 git管理 --- tools/building.py | 4 ++-- tools/targets/iar.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/building.py b/tools/building.py index d141797de42..26e13b3f84a 100644 --- a/tools/building.py +++ b/tools/building.py @@ -579,8 +579,8 @@ def DefineGroup(name, src, depend, **parameters): group['name'] = name group['path'] = group_path if type(src) == type([]): - # remove duplicate elements from list - src = list(set(src)) + # remove duplicate elements from list while preserving order + src = list(dict.fromkeys(src)) group['src'] = File(src) else: group['src'] = src diff --git a/tools/targets/iar.py b/tools/targets/iar.py index 39b28728e75..ee53ad2e001 100644 --- a/tools/targets/iar.py +++ b/tools/targets/iar.py @@ -131,10 +131,11 @@ def searchLib(group): print('not found LIB: ' + item) # make relative path - paths = set() + paths = {} for path in CPPPATH: inc = _make_path_relative(project_path, os.path.normpath(path)) - paths.add(inc) #.replace('\\', '/') + paths[inc] = None # 使用 dict 去重并保持插入顺序 + paths = list(paths.keys()) # setting options options = tree.findall('configuration/settings/data/option')