-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meson: Use a generated depfile for gi-docgen
Convert the output from "gi-docgen gen-deps", which is a list of files ingested to generate the documentation, into a format suitable to be read by Ninja (a Make snippet), and use it as the "depfile" for the documentation custom target. The transformation is done using a small Python script, which does not introduce any new dependency because gi-docgen itself already required Python to be present.
- Loading branch information
Showing
2 changed files
with
38 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#! /usr/bin/env python3 | ||
|
||
import sys | ||
|
||
if len(sys.argv) < 4: | ||
raise SystemExit(f"Usage: {sys.argv[0]} input output target [targets...]") | ||
|
||
with open(sys.argv[1], "r") as inp: | ||
with open(sys.argv[2], "w") as out: | ||
deps = set((line.strip() for line in inp.readlines())) | ||
print("# Automatically generated, do not edit!", file=out) | ||
print(" ".join(sys.argv[3:]), ": \\", file=out) | ||
print(" \\\n".join(deps), file=out) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters