Skip to content

Commit

Permalink
Add dep information to database dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
zyedidia committed Apr 25, 2023
1 parent 0f21fcf commit 369271f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rules/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ func (n *node) setDone(db *Database, noexec, hash bool) {
db.Prereqs.insert(n.rule.targets, f.name, n.dir)
}
}
if n.rule.attrs.Dep != "" {
prereqs := loadDeps(n.dir, nil, n.rule.attrs.Dep, n.myTarget, n.optional)
for _, p := range prereqs {
path, err := relify(p.name)
if err != nil {
panic(err)
}
db.Prereqs.insert(n.rule.targets, path, n.dir)
}
}
}
// TODO: think about path normalization?
db.Recipes.insert(n.rule.targets, n.recipe, n.dir)
Expand Down

0 comments on commit 369271f

Please sign in to comment.