gnome: genmarshal: If the source includes the header, depend on it

Otherwise we're racing between the header generation and the source
generation.
pull/9900/head
Dylan Baker 3 years ago committed by Eli Schwartz
parent 11f9638035
commit 457fb53ea4
  1. 33
      mesonbuild/modules/gnome.py

@ -1924,21 +1924,6 @@ class GnomeModule(ExtensionModule):
capture = True
header_file = output + '.h'
c_cmd = cmd + ['--body', '@INPUT@']
if mesonlib.version_compare(self._get_native_glib_version(state), '>= 2.53.4'):
# Silence any warnings about missing prototypes
c_cmd += ['--include-header', header_file]
body = build.CustomTarget(
output + '_c',
state.subdir,
state.subproject,
c_cmd,
sources,
[f'{output}.c'],
capture=capture,
depend_files=kwargs['depend_files'],
)
h_cmd = cmd + ['--header', '@INPUT@']
if new_genmarshal:
h_cmd += ['--pragma-once']
@ -1955,6 +1940,24 @@ class GnomeModule(ExtensionModule):
depend_files=kwargs['depend_files'],
)
c_cmd = cmd + ['--body', '@INPUT@']
extra_deps: T.List[build.CustomTarget] = []
if mesonlib.version_compare(self._get_native_glib_version(state), '>= 2.53.4'):
# Silence any warnings about missing prototypes
c_cmd += ['--include-header', header_file]
extra_deps.append(header)
body = build.CustomTarget(
output + '_c',
state.subdir,
state.subproject,
c_cmd,
sources,
[f'{output}.c'],
capture=capture,
depend_files=kwargs['depend_files'],
extra_depends=extra_deps,
)
rv = [body, header]
return ModuleReturnValue(rv, rv)

Loading…
Cancel
Save