diff options
author | Alexis Jeandet <alexis.jeandet@member.fsf.org> | 2017-11-28 01:23:02 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-11-28 22:50:31 +0200 |
commit | 120f7a4c4009990b2eed70ffbf019b5f7daf8268 (patch) | |
tree | e03c15923870594af369d8ea8b835c7a77d7347e /mesonbuild | |
parent | 746e70c0da73c3d20cb4456a8111355ad2202522 (diff) | |
download | meson-120f7a4c4009990b2eed70ffbf019b5f7daf8268.zip meson-120f7a4c4009990b2eed70ffbf019b5f7daf8268.tar.gz meson-120f7a4c4009990b2eed70ffbf019b5f7daf8268.tar.bz2 |
[Qt module] Added workaround for qt tools version detection
Depending on the tool (moc, uic, rcc, lrelease), the Qt version
(4.8, 5.7, 5.9) and the distribution (Fedora, debian,...) it seems you
cannot predict which of -v or -version will be supported.
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/modules/qt.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py index 463bf01..54e2c73 100644 --- a/mesonbuild/modules/qt.py +++ b/mesonbuild/modules/qt.py @@ -49,7 +49,11 @@ class QtBaseModule: # What kind of an idiot thought that was a good idea? for compiler, compiler_name in ((self.moc, "Moc"), (self.uic, "Uic"), (self.rcc, "Rcc"), (self.lrelease, "lrelease")): if compiler.found(): - stdout, stderr = Popen_safe(compiler.get_command() + ['-version'])[1:3] + # Workaround since there is no easy way to know which tool/version support which flag + for flag in ['-v', '-version']: + p, stdout, stderr = Popen_safe(compiler.get_command() + [flag])[0:3] + if p.returncode == 0: + break stdout = stdout.strip() stderr = stderr.strip() if 'Qt {}'.format(self.qt_version) in stderr: |