8000 meson: Use a generated depfile for gi-docgen by aperezdc · Pull Request #753 · Igalia/cog · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

meson: Use a generated depfile for gi-docgen #753

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions data/depfile.py
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)
37 changes: 25 additions & 12 deletions docs/meson.build
4934
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
gi_docgen_exe = find_program('gi-docgen', 'gi-docgen.py', native: true) 8000

# XXX: gi-docgen needs to be able to spit out a depfile.
docs_md = [
'contributing.md',
'overview.md',
'platform-drm.md',
'platform-headless.md',
'platform-wl.md',
'platform-x11.md',
'webdriver.md',
]
python3_exe = import('python').find_installation('python3')

docs_toml = configure_file(
configuration: {
Expand Down Expand Up @@ -38,11 +29,33 @@ gi_outputs = import('gnome').generate_gir(
)
gi_cogcore_gir = gi_outputs[0]

docs_dependencies_list = custom_target('docs-deps',
input: [docs_toml, gi_cogcore_gir],
output: ['cog-docs.deps'],
command: [gi_docgen_exe, 'gen-deps',
'--quiet',
'--content-dir', '@CURRENT_SOURCE_DIR@',
'--config', '@INPUT0@',
'@INPUT1@',
'@OUTPUT@',
],
)

docs_depfile = custom_target('docs-depfile',
input: [docs_dependencies_list],
output: ['cog-docs.d'],
command: [python3_exe, join_paths(meson.source_root(), 'data', 'depfile.py'),
'@INPUT@',
'@OUTPUT@',
'cog-docs.d', 'html'
],
)

custom_target('docs',
build_by_default: true,
input: [docs_toml, gi_cogcore_gir],
input: [docs_toml, gi_cogcore_gir, docs_depfile],
output: 'html',
depend_files: docs_md,
depfile: 'cog-docs.d',
command: [gi_docgen_exe, 'generate',
'--quiet',
'--no-namespace-dir',
Expand Down
Loading
0