diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-11-19 16:16:36 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-11-19 16:16:36 +0200 |
commit | 16fa65730469dacbdb9374858c090fe59c1aa70c (patch) | |
tree | 42baf8c8e7276af5d75fc4a79cef68b68e69b939 /backends.py | |
parent | 5f44748dddc22775864fe7c55e94a87547ab252e (diff) | |
download | meson-16fa65730469dacbdb9374858c090fe59c1aa70c.zip meson-16fa65730469dacbdb9374858c090fe59c1aa70c.tar.gz meson-16fa65730469dacbdb9374858c090fe59c1aa70c.tar.bz2 |
Can use built exes in custom targets.
Diffstat (limited to 'backends.py')
-rw-r--r-- | backends.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/backends.py b/backends.py index 26ab081..5710fac 100644 --- a/backends.py +++ b/backends.py @@ -352,6 +352,20 @@ class Backend(): deps.append(os.path.join(self.build_to_src, sp, 'meson_options.txt')) return deps + def exe_object_to_cmd_array(self, exe): + if self.environment.is_cross_build() and \ + isinstance(exe, build.BuildTarget) and exe.is_cross: + if 'exe_wrapper' not in self.environment.cross_info: + s = 'Can not use target %s as a generator because it is cross-built\n' + s += 'and no exe wrapper is defined. You might want to set it to native instead.' + s = s % exe.name + raise MesonException(s) + if isinstance(exe, build.BuildTarget): + exe_arr = [os.path.join(self.environment.get_build_dir(), self.get_target_filename(exe))] + else: + exe_arr = exe.get_command() + return exe_arr + def eval_custom_target_command(self, target, absolute_paths=False): ofilenames = [os.path.join(self.get_target_dir(target), i) for i in target.output] srcs = [] @@ -368,6 +382,9 @@ class Backend(): srcs.append(fname) cmd = [] for i in target.command: + if isinstance(i, build.Executable): + cmd += self.exe_object_to_cmd_array(i) + continue if isinstance(i, build.CustomTarget): # GIR scanner will attempt to execute this binary but # it assumes that it is in path, so always give it a full path. |