aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2020-04-06 15:26:40 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2020-04-11 23:18:43 +0300
commita54506fe46da7e5a1a4760a4e4eebda262bf585e (patch)
treed21c3c4c4314b466945d21bc8269c4447595dc52 /mesonbuild/backend/backends.py
parent77dad3153d3f0b9f2ffab933f410995b6c1991cf (diff)
downloadmeson-a54506fe46da7e5a1a4760a4e4eebda262bf585e.zip
meson-a54506fe46da7e5a1a4760a4e4eebda262bf585e.tar.gz
meson-a54506fe46da7e5a1a4760a4e4eebda262bf585e.tar.bz2
Handle BuildTarget as custom_target() argument #6914
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 687b122..afd8487 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -817,9 +817,9 @@ class Backend:
if delta > 0.001:
raise MesonException('Clock skew detected. File {} has a time stamp {:.4f}s in the future.'.format(absf, delta))
- def exe_object_to_cmd_array(self, exe):
- if isinstance(exe, build.BuildTarget):
- if exe.for_machine is not MachineChoice.BUILD:
+ def build_target_to_cmd_array(self, bt):
+ if isinstance(bt, build.BuildTarget):
+ if isinstance(bt, build.Executable) and bt.for_machine is not MachineChoice.BUILD:
if (self.environment.is_cross_build() and
self.environment.exe_wrapper is None and
self.environment.need_exe_wrapper()):
@@ -827,12 +827,12 @@ class Backend:
Cannot use target {} as a generator because it is built for the
host machine and no exe wrapper is defined or needs_exe_wrapper is
true. You might want to set `native: true` instead to build it for
- the build machine.'''.format(exe.name))
+ the build machine.'''.format(bt.name))
raise MesonException(s)
- exe_arr = [os.path.join(self.environment.get_build_dir(), self.get_target_filename(exe))]
+ arr = [os.path.join(self.environment.get_build_dir(), self.get_target_filename(bt))]
else:
- exe_arr = exe.get_command()
- return exe_arr
+ arr = bt.get_command()
+ return arr
def replace_extra_args(self, args, genlist):
final_args = []
@@ -960,8 +960,8 @@ class Backend:
# Evaluate the command list
cmd = []
for i in target.command:
- if isinstance(i, build.Executable):
- cmd += self.exe_object_to_cmd_array(i)
+ if isinstance(i, build.BuildTarget):
+ cmd += self.build_target_to_cmd_array(i)
continue
elif isinstance(i, build.CustomTarget):
# GIR scanner will attempt to execute this binary but