aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2021-02-08 21:46:00 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2021-02-08 21:46:00 +0200
commit1e2a70f0a2522b36b234e1b30a792c205cc15de3 (patch)
treec92b7f2396a8aa5833f6afc199882050a6c6bffe /mesonbuild/backend/backends.py
parent398df5629863e913fa603cbf02c525a9f501f8a8 (diff)
downloadmeson-exewrapfix.zip
meson-exewrapfix.tar.gz
meson-exewrapfix.tar.bz2
Fix exe wrapper detection for run targets.exewrapfix
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index e19afca..df9c9eb 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -397,9 +397,17 @@ class Backend:
if isinstance(exe, dependencies.ExternalProgram):
exe_cmd = exe.get_command()
exe_for_machine = exe.for_machine
- elif isinstance(exe, (build.BuildTarget, build.CustomTarget)):
+ elif isinstance(exe, build.BuildTarget):
exe_cmd = [self.get_target_filename_abs(exe)]
exe_for_machine = exe.for_machine
+ elif isinstance(exe, build.CustomTarget):
+ # The output of a custom target can either be directly runnable
+ # or not, that is, a script, a native binary or a cross compiled
+ # binary when exe wrapper is available and when it is not.
+ # This implementation is not exhaustive but it works in the
+ # common cases.
+ exe_cmd = [self.get_target_filename_abs(exe)]
+ exe_for_machine = MachineChoice.BUILD
else:
exe_cmd = [exe]
exe_for_machine = MachineChoice.BUILD
@@ -470,6 +478,8 @@ class Backend:
if isinstance(exe, (dependencies.ExternalProgram,
build.BuildTarget, build.CustomTarget)):
basename = exe.name
+ elif isinstance(exe, mesonlib.File):
+ basename = os.path.basename(exe.fname)
else:
basename = os.path.basename(exe)