aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/gnome.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2022-04-04 09:59:07 -0400
committerEli Schwartz <eschwartz93@gmail.com>2022-04-07 23:44:34 -0400
commite5aa47d8af917282794a8da3956ce444b8d8378d (patch)
tree9ec83d2a2d8fd4adf35b50d91b48719b1d3e6683 /mesonbuild/modules/gnome.py
parent99f510a817f1408e87813d33e4ef6fdd21d2bc20 (diff)
downloadmeson-e5aa47d8af917282794a8da3956ce444b8d8378d.zip
meson-e5aa47d8af917282794a8da3956ce444b8d8378d.tar.gz
meson-e5aa47d8af917282794a8da3956ce444b8d8378d.tar.bz2
Revert "wayland: Also lookup scanner in pkgconfig"
This reverts commit 7954a4c9cbf8355d8c8ea9b3d98df45d9f96f66e.
Diffstat (limited to 'mesonbuild/modules/gnome.py')
-rw-r--r--mesonbuild/modules/gnome.py22
1 files changed, 19 insertions, 3 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 2e7b2a7..8c63647 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -321,9 +321,25 @@ class GnomeModule(ExtensionModule):
def _get_native_binary(self, state: 'ModuleState', name: str, depname: str,
varname: str, required: bool = True) -> T.Union[ExternalProgram, OverrideProgram, 'build.Executable']:
- return state.find_program(name, for_machine=MachineChoice.BUILD,
- required=required,
- depname=depname, varname=varname)
+ # Look in overrides in case glib/gtk/etc are built as subproject
+ prog = self.interpreter.program_from_overrides([name], [])
+ if prog is not None:
+ return prog
+
+ # Look in machine file
+ prog_list = state.environment.lookup_binary_entry(MachineChoice.HOST, name)
+ if prog_list is not None:
+ return ExternalProgram.from_entry(name, prog_list)
+
+ # Check if pkgconfig has a variable
+ dep = self._get_dep(state, depname, native=True, required=False)
+ if dep.found() and dep.type_name == 'pkgconfig':
+ value = dep.get_pkgconfig_variable(varname, [], None)
+ if value:
+ return ExternalProgram(name, [value])
+
+ # Normal program lookup
+ return state.find_program(name, required=required)
@typed_kwargs(
'gnome.post_install',