aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/backend/backends.py17
-rw-r--r--mesonbuild/backend/ninjabackend.py2
-rw-r--r--mesonbuild/backend/vs2010backend.py2
3 files changed, 4 insertions, 17 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 0ab5061..a29cac8 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -21,7 +21,6 @@ import json
import os
import pickle
import re
-import textwrap
import typing as T
import hashlib
import copy
@@ -978,18 +977,8 @@ 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 build_target_to_cmd_array(self, bt, check_cross):
+ def build_target_to_cmd_array(self, bt):
if isinstance(bt, build.BuildTarget):
- if check_cross and 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()):
- s = textwrap.dedent('''
- 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(bt.name))
- raise MesonException(s)
arr = [os.path.join(self.environment.get_build_dir(), self.get_target_filename(bt))]
else:
arr = bt.get_command()
@@ -1120,11 +1109,9 @@ class Backend:
inputs = self.get_custom_target_sources(target)
# Evaluate the command list
cmd = []
- index = -1
for i in target.command:
- index += 1
if isinstance(i, build.BuildTarget):
- cmd += self.build_target_to_cmd_array(i, (index == 0))
+ cmd += self.build_target_to_cmd_array(i)
continue
elif isinstance(i, build.CustomTarget):
# GIR scanner will attempt to execute this binary but
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 2bd22bf..130a253 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -2066,7 +2066,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
generator = genlist.get_generator()
subdir = genlist.subdir
exe = generator.get_exe()
- exe_arr = self.build_target_to_cmd_array(exe, True)
+ exe_arr = self.build_target_to_cmd_array(exe)
infilelist = genlist.get_inputs()
outfilelist = genlist.get_outputs()
extra_dependencies = self.get_custom_target_depend_files(genlist)
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py
index f4e2bd0..e94ab49 100644
--- a/mesonbuild/backend/vs2010backend.py
+++ b/mesonbuild/backend/vs2010backend.py
@@ -121,7 +121,7 @@ class Vs2010Backend(backends.Backend):
infilelist = genlist.get_inputs()
outfilelist = genlist.get_outputs()
source_dir = os.path.join(down, self.build_to_src, genlist.subdir)
- exe_arr = self.build_target_to_cmd_array(exe, True)
+ exe_arr = self.build_target_to_cmd_array(exe)
idgroup = ET.SubElement(parent_node, 'ItemGroup')
for i in range(len(infilelist)):
if len(infilelist) == len(outfilelist):