aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-05-13 12:11:18 -0700
committerDylan Baker <dylan@pnwbakers.com>2020-05-14 11:04:51 -0700
commita63e36f7b114d66f455936fa6621b30a3a54675f (patch)
treea9d141600baaa5d153810b1a1108976cb23f0221 /mesonbuild
parent4e9e35f3bd17a8f110ae1d3b40c8fbe04700120a (diff)
downloadmeson-a63e36f7b114d66f455936fa6621b30a3a54675f.zip
meson-a63e36f7b114d66f455936fa6621b30a3a54675f.tar.gz
meson-a63e36f7b114d66f455936fa6621b30a3a54675f.tar.bz2
interpreter: Rename has_exe_wrapper -> can_run_host_binaries
The implementation of this function has changed enough that the name doesn't really reflect what it actually does. It basically returns true unless you're cross compiling, need and exe_wrapper, and don't have one. The original function remains but is marked as deprecated. This makes one small change the meson source language, which is that it defines that can_run_host_binaries will return true in build == host compilation, which was the behavior that already existed. Previously this was undefined in build == host compilation.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/interpreter.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 7901e5a..8c7a82c 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -1873,6 +1873,7 @@ class MesonMain(InterpreterObject):
self.methods.update({'get_compiler': self.get_compiler_method,
'is_cross_build': self.is_cross_build_method,
'has_exe_wrapper': self.has_exe_wrapper_method,
+ 'can_run_host_binaries': self.can_run_host_binaries_method,
'is_unity': self.is_unity_method,
'is_subproject': self.is_subproject_method,
'current_source_dir': self.current_source_dir_method,
@@ -2023,9 +2024,16 @@ class MesonMain(InterpreterObject):
@noPosargs
@permittedKwargs({})
- def has_exe_wrapper_method(self, args, kwargs):
- if self.is_cross_build_method(None, None) and \
- self.build.environment.need_exe_wrapper():
+ @FeatureDeprecated('meson.has_exe_wrapper', '0.55.0', 'use meson.can_run_host_binaries instead.')
+ def has_exe_wrapper_method(self, args: T.Tuple[object, ...], kwargs: T.Dict[str, object]) -> bool:
+ return self.can_run_host_binaries_method(args, kwargs)
+
+ @noPosargs
+ @permittedKwargs({})
+ @FeatureNew('meson.can_run_host_binaries', '0.55.0')
+ def can_run_host_binaries_method(self, args: T.Tuple[object, ...], kwargs: T.Dict[str, object]) -> bool:
+ if (self.is_cross_build_method(None, None) and
+ self.build.environment.need_exe_wrapper()):
if self.build.environment.exe_wrapper is None:
return False
# We return True when exe_wrap is defined, when it's not needed, and