feat(rule): let a rule use a target as its tool

This commit is contained in:
milner committed 2022-07-25 20:44:53 +00:00
1 parent b3a2340a22
commit 710b2578c6
3 files changed
+17 -2

No files matched your search

+4 -1
View File
@@ -112,8 +112,11 @@ let of_project p =
List.iter
(fun r ->
let cmd = Array.of_list r.rcmd in
(* a tool the rule runs is an input like any other, so building it first is
ordering and rebuilding it is invalidation *)
let tools = List.filter_map (fun u -> Option.map (out_of p) (find p u)) r.ruses in
add
(Graph.make ~id:!n ~tag:"gen" ~label:r.rdesc ~cmd ~outs:r.routs ~ins:r.rin ()))
(Graph.make ~id:!n ~tag:"gen" ~label:r.rdesc ~cmd ~outs:r.routs ~ins:(r.rin @ tools) ()))
p.rules;
let outputs = Hashtbl.create 16 in
List.iter