From 0eade4f3c6eb6d47c546152b40302ea7b59660a0 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Wed, 21 Feb 2018 18:30:42 +0000 Subject: [PATCH] Fix dependency('qt4|5', method: 'qmake') for Cygwin Fix dependency('qt4|5', method: 'qmake') detection when shared library extension isn't .so Note that OSX already has a special case to look for .framework --- mesonbuild/dependencies/ui.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py index a84decfcf..bc3eafc65 100644 --- a/mesonbuild/dependencies/ui.py +++ b/mesonbuild/dependencies/ui.py @@ -23,7 +23,7 @@ from collections import OrderedDict from .. import mlog from .. import mesonlib from ..mesonlib import ( - MesonException, Popen_safe, extract_as_list, for_windows, + MesonException, Popen_safe, extract_as_list, for_windows, for_cygwin, version_compare_many ) from ..environment import detect_cpu @@ -285,6 +285,10 @@ class QtBaseDependency(ExternalDependency): incdir = qvars['QT_INSTALL_HEADERS'] self.compile_args.append('-I' + incdir) libdir = qvars['QT_INSTALL_LIBS'] + if for_cygwin(self.env.is_cross_build(), self.env): + shlibext = '.dll.a' + else: + shlibext = '.so' # Used by self.compilers_detect() self.bindir = self.get_qmake_host_bins(qvars) self.is_found = True @@ -306,7 +310,7 @@ class QtBaseDependency(ExternalDependency): self.is_found = False break else: - libfile = os.path.join(libdir, 'lib{}{}.so'.format(self.qtpkgname, module)) + libfile = os.path.join(libdir, 'lib{}{}{}'.format(self.qtpkgname, module, shlibext)) if not os.path.isfile(libfile): self.is_found = False break