diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-01-19 14:05:54 -0800 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-01-28 15:53:20 -0500 |
commit | 457fb53ea46ee06796261d69f966fb9325ebcd3c (patch) | |
tree | effe9c25432ae1ef6e5172d3a8c0efae2133063d /mesonbuild/modules | |
parent | 11f96380351a88059ec55f1070fdebc1b1033117 (diff) | |
download | meson-457fb53ea46ee06796261d69f966fb9325ebcd3c.zip meson-457fb53ea46ee06796261d69f966fb9325ebcd3c.tar.gz meson-457fb53ea46ee06796261d69f966fb9325ebcd3c.tar.bz2 |
gnome: genmarshal: If the source includes the header, depend on it
Otherwise we're racing between the header generation and the source
generation.
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r-- | mesonbuild/modules/gnome.py | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 37d4d92..a3df14b 100644 --- a/mesonbuild/modules/gnome.py +++ b/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) |