Skip to content

Commit

Permalink
qt: fix qt 6 tools detection for pkg-config
Browse files Browse the repository at this point in the history
Add correct reading of pkgconfig-announced bindir and
pkgconfig-announced libexecdir. Will work only on 6.3+
  • Loading branch information
rilian-la-te authored and nirbheek committed Aug 12, 2022
1 parent 988890c commit 2a97817
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion mesonbuild/dependencies/qt.py
Expand Up @@ -223,11 +223,18 @@ def __init__(self, name: str, env: 'Environment', kwargs: T.Dict[str, T.Any]):
if prefix:
self.bindir = os.path.join(prefix, 'bin')

self.libexecdir = self.get_pkgconfig_host_libexecs(self)

@staticmethod
@abc.abstractmethod
def get_pkgconfig_host_bins(core: PkgConfigDependency) -> T.Optional[str]:
pass

@staticmethod
@abc.abstractmethod
def get_pkgconfig_host_libexecs(core: PkgConfigDependency) -> T.Optional[str]:
pass

@abc.abstractmethod
def get_private_includes(self, mod_inc_dir: str, module: str) -> T.List[str]:
pass
Expand Down Expand Up @@ -405,13 +412,21 @@ def get_pkgconfig_host_bins(core: PkgConfigDependency) -> T.Optional[str]:
def get_private_includes(self, mod_inc_dir: str, module: str) -> T.List[str]:
return []

@staticmethod
def get_pkgconfig_host_libexecs(core: PkgConfigDependency) -> str:
return None


class Qt5PkgConfigDependency(QtPkgConfigDependency):

@staticmethod
def get_pkgconfig_host_bins(core: PkgConfigDependency) -> str:
return core.get_pkgconfig_variable('host_bins', [], None)

@staticmethod
def get_pkgconfig_host_libexecs(core: PkgConfigDependency) -> str:
return None

def get_private_includes(self, mod_inc_dir: str, module: str) -> T.List[str]:
return _qt_get_private_includes(mod_inc_dir, module, self.version)

Expand All @@ -420,7 +435,12 @@ class Qt6PkgConfigDependency(QtPkgConfigDependency):

@staticmethod
def get_pkgconfig_host_bins(core: PkgConfigDependency) -> str:
return core.get_pkgconfig_variable('host_bins', [], None)
return core.get_pkgconfig_variable('bindir', [], None)

@staticmethod
def get_pkgconfig_host_libexecs(core: PkgConfigDependency) -> str:
# Qt6 pkg-config for Qt defines libexecdir from 6.3+
return core.get_pkgconfig_variable('libexecdir', [], None)

def get_private_includes(self, mod_inc_dir: str, module: str) -> T.List[str]:
return _qt_get_private_includes(mod_inc_dir, module, self.version)
Expand Down

0 comments on commit 2a97817

Please sign in to comment.