diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-06-29 19:33:17 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-07-01 13:59:48 +0000 |
commit | ec29f19c1274d72e3a2639e47caf4a7f17ffa436 (patch) | |
tree | 70ffad6c031159508e92b05ff69acbc052262480 /mesonbuild/dependencies/ui.py | |
parent | ae8d044cb6dca20c1d6504a27660bcbed16db438 (diff) | |
download | meson-ec29f19c1274d72e3a2639e47caf4a7f17ffa436.zip meson-ec29f19c1274d72e3a2639e47caf4a7f17ffa436.tar.gz meson-ec29f19c1274d72e3a2639e47caf4a7f17ffa436.tar.bz2 |
Add a helper for fetching of binaries from cross files
A number of cases have to be taken care of while doing this, so
refactor it into a helper on ExternalProgram and use it everywhere.
1. Command is a list of len > 1, use it as-is
2. Command is a list of len == 1 (or a string), use as a string
3. If command is an absolute path, use it as-is
4. If command is not an absolute path, search for it
Diffstat (limited to 'mesonbuild/dependencies/ui.py')
-rw-r--r-- | mesonbuild/dependencies/ui.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py index 72958dd..324f9fa 100644 --- a/mesonbuild/dependencies/ui.py +++ b/mesonbuild/dependencies/ui.py @@ -291,10 +291,10 @@ class QtBaseDependency(ExternalDependency): self.bindir = os.path.join(prefix, 'bin') def _find_qmake(self, qmake): - # Even when cross-compiling, if we don't get a cross-info qmake, we + # Even when cross-compiling, if a cross-info qmake is not specified, we # fallback to using the qmake in PATH because that's what we used to do - if self.env.is_cross_build(): - qmake = self.env.cross_info.config['binaries'].get('qmake', qmake) + if self.env.is_cross_build() and 'qmake' in self.env.cross_info.config['binaries']: + return ExternalProgram.from_cross_info(self.env.cross_info, 'qmake') return ExternalProgram(qmake, silent=True) def _qmake_detect(self, mods, kwargs): |