diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-12-14 22:03:56 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-12-15 04:12:23 +0530 |
commit | 79f66268676ec8bf94c6964a555ecc9144daca8e (patch) | |
tree | 26807f1e9e3572429ddd8995b3f1287ae6f8f57e /mesonbuild/backend/backends.py | |
parent | 807a53c6fc2e4e4fad12f4f4b6f1343eea30e9c7 (diff) | |
download | meson-79f66268676ec8bf94c6964a555ecc9144daca8e.zip meson-79f66268676ec8bf94c6964a555ecc9144daca8e.tar.gz meson-79f66268676ec8bf94c6964a555ecc9144daca8e.tar.bz2 |
Pass --gresources to valac for each compiled gresource
Without this, the user has to both compile the resource with
gnome.compile_resources, pass that to the target sources, and also
pass --gresources=/path/to/gres.xml to vala_args in the target.
With this, we will do that automatically.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 48dfb11..a489d04 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -504,19 +504,13 @@ class Backend(): libs.append(os.path.join(self.get_target_dir(t), f)) return libs - def eval_custom_target_command(self, target, absolute_paths=False): - if not absolute_paths: - ofilenames = [os.path.join(self.get_target_dir(target), i) for i in target.output] - else: - ofilenames = [os.path.join(self.environment.get_build_dir(), self.get_target_dir(target), i) \ - for i in target.output] + def get_custom_target_sources(self, target, absolute_paths=False): + ''' + Custom target sources can be of various object types; strings, File, + BuildTarget, even other CustomTargets. + Returns the path to them relative to the build root directory. + ''' srcs = [] - outdir = self.get_target_dir(target) - # Many external programs fail on empty arguments. - if outdir == '': - outdir = '.' - if absolute_paths: - outdir = os.path.join(self.environment.get_build_dir(), outdir) for i in target.get_sources(): if hasattr(i, 'held_object'): i = i.held_object @@ -531,8 +525,23 @@ class Backend(): else: fname = [i.rel_to_builddir(self.build_to_src)] if absolute_paths: - fname =[os.path.join(self.environment.get_build_dir(), f) for f in fname] + fname = [os.path.join(self.environment.get_build_dir(), f) for f in fname] srcs += fname + return srcs + + def eval_custom_target_command(self, target, absolute_paths=False): + if not absolute_paths: + ofilenames = [os.path.join(self.get_target_dir(target), i) for i in target.output] + else: + ofilenames = [os.path.join(self.environment.get_build_dir(), self.get_target_dir(target), i) \ + for i in target.output] + srcs = self.get_custom_target_sources(target, absolute_paths) + outdir = self.get_target_dir(target) + # Many external programs fail on empty arguments. + if outdir == '': + outdir = '.' + if absolute_paths: + outdir = os.path.join(self.environment.get_build_dir(), outdir) cmd = [] for i in target.command: if isinstance(i, build.Executable): |