diff options
| author | 蒙蒙plus <[email protected]> | 2025-12-30 17:26:23 +0800 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2026-01-01 22:57:49 -0500 |
| commit | d9c74834b096170f6eeb01811fc5a1e1929f8aab (patch) | |
| tree | 3f70119fb4d1e646aa22306fee7a656f94521b7b | |
| parent | c39e92f4c1f1fa2e991c6c52838f85eb93d44415 (diff) | |
fix: 更换去重算法,保证工程输出一致性
便于 git管理
| -rw-r--r-- | tools/building.py | 4 | ||||
| -rw-r--r-- | tools/targets/iar.py | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/tools/building.py b/tools/building.py index d141797de4..26e13b3f84 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 39b28728e7..ee53ad2e00 100644 --- a/tools/targets/iar.py +++ b/tools/targets/iar.py @@ -131,10 +131,11 @@ def IARProject(env, target, script): 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') |
