Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
olofk committed Feb 1, 2025
1 parent e438f9f commit fe7adb7
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions edalize/tools/vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ class Vcs(Edatool):
}

def setup(self, edam):
def absorb_node(nodes, node_to_absorb):
for node, deps in nodes.items():
if node_to_absorb in deps:
deps.remove(node_to_absorb)
deps += nodes[node_to_absorb]
del nodes[node_to_absorb]

super().setup(edam)

incdirs = []
Expand All @@ -58,7 +65,6 @@ def setup(self, edam):
unused_files.remove(f)

user_files = []
commands = {}
libs = {}
has_sv = False
for f in unused_files.copy():
Expand Down Expand Up @@ -99,9 +105,6 @@ def setup(self, edam):
if not lib in libs:
libs[lib] = []
libs[lib].append((cmd, f["name"], defines))
if not commands.get((cmd, lib, defines)):
commands[(cmd, lib, defines)] = []
commands[(cmd, lib, defines)].append(f["name"])
unused_files.remove(f)

full64 = [] if self.tool_options.get("32bit") else ["-full64"]
Expand All @@ -110,6 +113,10 @@ def setup(self, edam):
self.workdirs = []
target_files = []
libdeps = self.edam.get("library_dependencies", {})
for lib, files in libdeps.copy().items():
if not files:
absorb_node(libdeps, lib)

for lib, files in libs.items():
cmds = {}
has_vlog = False
Expand All @@ -120,7 +127,6 @@ def setup(self, edam):
cmds[(cmd, defines)].append(fname)
if cmd == "vlogan":
has_vlog = True
commands = [["mkdir", "-p", lib]]
i = 0
f_files = {}
for (cmd, defines), fnames in cmds.items():
Expand Down

0 comments on commit fe7adb7

Please sign in to comment.