diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-10-27 11:02:04 -0700 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2021-10-27 20:50:29 -0400 |
commit | ae35b1f45ac5850547f2db52b7b50a54789fcca1 (patch) | |
tree | a992bf7bf61c6c19b56ddfc50c38970fd1c9e026 /mesonbuild/modules/gnome.py | |
parent | 3902bd4ef15ed1c50b008ba2e0e0dad79ff185f4 (diff) | |
download | meson-ae35b1f45ac5850547f2db52b7b50a54789fcca1.zip meson-ae35b1f45ac5850547f2db52b7b50a54789fcca1.tar.gz meson-ae35b1f45ac5850547f2db52b7b50a54789fcca1.tar.bz2 |
modules/gnome: ensure that `install_dir` is set
The `mkenums` functions can have this unset if, and only if, the
c file only variant is called. Due to side effects if the header file is
generated then `install_dir` is ensured to be set for the c file. I have
removed this side effect so that our tests actually cover this case.
Fixes #9472
Diffstat (limited to 'mesonbuild/modules/gnome.py')
-rw-r--r-- | mesonbuild/modules/gnome.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 10ad22d..38dc5f7 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -1434,13 +1434,16 @@ class GnomeModule(ExtensionModule): # so --template consumes it. h_cmd = cmd + ['--template', '@INPUT@'] h_sources = [h_template] + sources - custom_kwargs['install'] = install_header - if 'install_dir' not in custom_kwargs: - custom_kwargs['install_dir'] = \ + + # Copy so we don't mutate the arguments for the c_template + h_kwargs = custom_kwargs.copy() + h_kwargs['install'] = install_header + if 'install_dir' not in h_kwargs: + h_kwargs['install_dir'] = \ state.environment.coredata.get_option(mesonlib.OptionKey('includedir')) h_target = self._make_mkenum_custom_target(state, h_sources, h_output, h_cmd, - custom_kwargs) + h_kwargs) targets.append(h_target) if c_template is not None: @@ -1449,16 +1452,19 @@ class GnomeModule(ExtensionModule): # so --template consumes it. c_cmd = cmd + ['--template', '@INPUT@'] c_sources = [c_template] + sources + + c_kwargs = custom_kwargs.copy() # Never install the C file. Complain on bug tracker if you need it. - custom_kwargs['install'] = False + c_kwargs['install'] = False + c_kwargs['install_dir'] = False if h_template is not None: if 'depends' in custom_kwargs: - custom_kwargs['depends'] += [h_target] + c_kwargs['depends'] += [h_target] else: - custom_kwargs['depends'] = h_target + c_kwargs['depends'] = h_target c_target = self._make_mkenum_custom_target(state, c_sources, c_output, c_cmd, - custom_kwargs) + c_kwargs) targets.insert(0, c_target) if c_template is None and h_template is None: |