Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def load_build_dep_ninja(ninja_path, work_dir, ninja_deps=None):
manifest = ninja.Parser().parse(ninja_path, 'utf-8', ninja_deps)
graph = collections.defaultdict(set)
for build in manifest.builds:
for path in itertools.chain(build.explicit_outs, build.implicit_outs):
ins = graph[path]
ins.update(build.explicit_ins)
ins.update(build.implicit_ins)
ins.update(build.depfile_implicit_ins)
return load_build_dep_graph(graph)