Skip to content

Commit

Permalink
Update ab.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgiven committed Oct 14, 2024
1 parent e07a906 commit c6e2958
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build/_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
(_, current, max) = sys.argv
percent = int(100 * float(current) / float(max))
print(f"[{percent:>3}%]")
except ValueError:
except:
pass
6 changes: 4 additions & 2 deletions build/c.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, cflags):
t = simplerule(
replaces=self,
ins=srcs,
deps=sorted(hdr_deps),
deps=sorted(_indirect(hdr_deps, "cheader_files")),
outs=[outleaf],
label=label,
commands=commands,
Expand Down Expand Up @@ -216,6 +216,8 @@ def libraryimpl(
self.deps = self.outs
self.args["cheader_deps"] = hdr_deps
self.args["clibrary_deps"] = lib_deps
self.args["cheader_files"] = [hr] if hr else []
self.args["clibrary_files"] = [ar] if ar else []
self.args["caller_cflags"] = caller_cflags + hf
self.args["caller_ldflags"] = caller_ldflags

Expand Down Expand Up @@ -323,7 +325,7 @@ def programimpl(
replaces=self,
ins=cfiles + libs,
outs=[f"={self.localname}$(EXT)"],
deps=deps,
deps=sorted(_indirect(lib_deps, "clibrary_files")),
label=toolchain.label + label,
commands=commands,
args={
Expand Down
19 changes: 12 additions & 7 deletions build/pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,18 @@ def _package(self, name, package, fallback, pkgconfig):
fallback
), f"Required package '{package}' not installed when materialising target '{name}'"

self.args["cheader_deps"] = fallback.args.get("cheader_deps", {fallback})
self.args["clibrary_deps"] = fallback.args.get("clibrary_deps", {fallback})
self.ins = []
self.outs = []
self.deps = [fallback]
self.traits.add("clibrary")
self.traits.add("cheaders")
if "cheader_deps" in fallback.args:
self.args["cheader_deps"] = fallback.args["cheader_deps"]
if "clibrary_deps" in fallback.args:
self.args["clibrary_deps"] = fallback.args["clibrary_deps"]
if "cheader_files" in fallback.args:
self.args["cheader_files"] = fallback.args["cheader_files"]
if "clibrary_files" in fallback.args:
self.args["clibrary_files"] = fallback.args["clibrary_files"]
self.ins = fallback.ins
self.outs = fallback.outs
self.deps = fallback.deps
self.traits = fallback.traits


@Rule
Expand Down

0 comments on commit c6e2958

Please sign in to comment.