aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2023-08-31 14:13:50 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2023-09-08 13:08:05 +0530
commit6cfd2b4d5bd30b372268c25308b1cb00afd0996d (patch)
tree0832257429d96a591668b0e737b2647c1ed6a227
parent204fe3c5772f3f6ec9583fb9216412a4eb6018b9 (diff)
downloadmeson-6cfd2b4d5bd30b372268c25308b1cb00afd0996d.zip
meson-6cfd2b4d5bd30b372268c25308b1cb00afd0996d.tar.gz
meson-6cfd2b4d5bd30b372268c25308b1cb00afd0996d.tar.bz2
Override config-tool get_variable args for qmake
-rw-r--r--mesonbuild/dependencies/configtool.py5
-rw-r--r--mesonbuild/dependencies/qt.py3
-rw-r--r--test cases/frameworks/4 qt/meson.build3
3 files changed, 10 insertions, 1 deletions
diff --git a/mesonbuild/dependencies/configtool.py b/mesonbuild/dependencies/configtool.py
index 5a4294e..8dda298 100644
--- a/mesonbuild/dependencies/configtool.py
+++ b/mesonbuild/dependencies/configtool.py
@@ -150,8 +150,11 @@ class ConfigToolDependency(ExternalDependency):
return []
return split_args(out)
+ def get_variable_args(self, variable_name: str) -> T.List[str]:
+ return [f'--{variable_name}']
+
def get_configtool_variable(self, variable_name: str) -> str:
- p, out, _ = Popen_safe(self.config + [f'--{variable_name}'])
+ p, out, _ = Popen_safe(self.config + self.get_variable_args(variable_name))
if p.returncode != 0:
if self.required:
raise DependencyException(
diff --git a/mesonbuild/dependencies/qt.py b/mesonbuild/dependencies/qt.py
index 1a86bd2..ceb0321 100644
--- a/mesonbuild/dependencies/qt.py
+++ b/mesonbuild/dependencies/qt.py
@@ -350,6 +350,9 @@ class QmakeQtDependency(_QtBase, ConfigToolDependency, metaclass=abc.ABCMeta):
return m.group(0).rstrip('.')
return version
+ def get_variable_args(self, variable_name: str) -> T.List[str]:
+ return ['-query', f'{variable_name}']
+
@abc.abstractmethod
def get_private_includes(self, mod_inc_dir: str, module: str) -> T.List[str]:
pass
diff --git a/test cases/frameworks/4 qt/meson.build b/test cases/frameworks/4 qt/meson.build
index 04a5288..f8ba175 100644
--- a/test cases/frameworks/4 qt/meson.build
+++ b/test cases/frameworks/4 qt/meson.build
@@ -50,6 +50,9 @@ foreach qt : ['qt4', 'qt5', 'qt6']
qtmodule = import(qt)
assert(qtmodule.has_tools())
+ # Test that fetching a variable works and yields a non-empty value
+ assert(qtdep.get_variable('prefix', configtool: 'QT_INSTALL_PREFIX') != '')
+
# The following has two resource files because having two in one target
# requires you to do it properly or you get linker symbol clashes.