Skip to content

Commit 6cfd2b4

Browse files
committed
Override config-tool get_variable args for qmake
1 parent 204fe3c commit 6cfd2b4

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

mesonbuild/dependencies/configtool.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,11 @@ def get_config_value(self, args: T.List[str], stage: str) -> T.List[str]:
150150
return []
151151
return split_args(out)
152152

153+
def get_variable_args(self, variable_name: str) -> T.List[str]:
154+
return [f'--{variable_name}']
155+
153156
def get_configtool_variable(self, variable_name: str) -> str:
154-
p, out, _ = Popen_safe(self.config + [f'--{variable_name}'])
157+
p, out, _ = Popen_safe(self.config + self.get_variable_args(variable_name))
155158
if p.returncode != 0:
156159
if self.required:
157160
raise DependencyException(

mesonbuild/dependencies/qt.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,9 @@ def _sanitize_version(self, version: str) -> str:
350350
return m.group(0).rstrip('.')
351351
return version
352352

353+
def get_variable_args(self, variable_name: str) -> T.List[str]:
354+
return ['-query', f'{variable_name}']
355+
353356
@abc.abstractmethod
354357
def get_private_includes(self, mod_inc_dir: str, module: str) -> T.List[str]:
355358
pass

test cases/frameworks/4 qt/meson.build

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ foreach qt : ['qt4', 'qt5', 'qt6']
5050
qtmodule = import(qt)
5151
assert(qtmodule.has_tools())
5252

53+
# Test that fetching a variable works and yields a non-empty value
54+
assert(qtdep.get_variable('prefix', configtool: 'QT_INSTALL_PREFIX') != '')
55+
5356
# The following has two resource files because having two in one target
5457
# requires you to do it properly or you get linker symbol clashes.
5558

0 commit comments

Comments
 (0)