Skip to content

Commit

Permalink
Fix dependency('qt4|5', method: 'qmake') for Cygwin
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jon-turney committed Mar 4, 2018
1 parent 7e52ba0 commit 0eade4f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mesonbuild/dependencies/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
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
Expand Down Expand Up @@ -285,6 +285,10 @@ def _qmake_detect(self, mods, kwargs):
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
Expand All @@ -306,7 +310,7 @@ def _qmake_detect(self, mods, kwargs):
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
Expand Down

0 comments on commit 0eade4f

Please sign in to comment.