Skip to content

Commit

Permalink
fix component dependency find error
Browse files Browse the repository at this point in the history
  • Loading branch information
Neutree committed Nov 28, 2024
1 parent bebbcaa commit 0b269d4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/cmake/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,14 @@ def find_valid_components(components):
continue
depends[name].append(r)
# find main depends
def get_depend_recursive(name):
d = depends[name]
def get_depend_recursive(name, seen={}):
if name in seen:
return seen[name]
d = depends[name].copy()
for r in depends[name]:
d.extend(get_depend_recursive(r))
d.extend(get_depend_recursive(r, seen))
d = list(set(d))
seen[name] = d
return d
valid = ["main"]
valid.extend(get_depend_recursive("main"))
Expand Down

0 comments on commit 0b269d4

Please sign in to comment.