diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2021-02-05 10:44:32 -0500 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2021-02-05 18:17:08 -0500 |
commit | b52794b24b61dbd39f4bacf7374ec9337caf89ff (patch) | |
tree | 013d20c69b7e1eaa3533ae9dab05ee8cf7f46da8 /mesonbuild/backend/backends.py | |
parent | 522392e7553823e6b3ac38cadc4fbee72eae9540 (diff) | |
download | meson-b52794b24b61dbd39f4bacf7374ec9337caf89ff.zip meson-b52794b24b61dbd39f4bacf7374ec9337caf89ff.tar.gz meson-b52794b24b61dbd39f4bacf7374ec9337caf89ff.tar.bz2 |
backend: Do not check for exe wrapper twice
It is already checked by as_meson_exe_cmdline().
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 17 |
1 files changed, 2 insertions, 15 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 |