meson: Remove version_h dependency from jinja2_cmdline

version_h includes GIT_VERSION which only makes sense for C files
which aren't preprocessed by jinja2 so remove the argument.

The end result of this change is that the man pages are not recompiled
anymore every time GIT_VERSION changes.
This commit is contained in:
Daan De Meyer 2024-03-06 15:16:52 +01:00
parent 76940e0a04
commit 5c25f9dbc5
2 changed files with 5 additions and 6 deletions

View file

@ -1887,7 +1887,7 @@ config_h = configure_file(
userspace_c_args += ['-include', 'config.h']
jinja2_cmdline = [meson_render_jinja2, config_h, version_h]
jinja2_cmdline = [meson_render_jinja2, config_h]
userspace = declare_dependency(
compile_args : userspace_c_args,

View file

@ -33,12 +33,11 @@ def render(filename, defines):
def main():
defines = parse_config_h(sys.argv[1])
defines.update(parse_config_h(sys.argv[2]))
output = render(sys.argv[3], defines)
with open(sys.argv[4], 'w') as f:
output = render(sys.argv[2], defines)
with open(sys.argv[3], 'w') as f:
f.write(output)
info = os.stat(sys.argv[3])
os.chmod(sys.argv[4], info.st_mode)
info = os.stat(sys.argv[2])
os.chmod(sys.argv[3], info.st_mode)
if __name__ == '__main__':
main()