diff options
author | TheQwertiest <qwertiest@mail.ru> | 2019-03-27 19:18:39 +0300 |
---|---|---|
committer | TheQwertiest <qwertiest@mail.ru> | 2019-04-29 16:07:50 +0300 |
commit | 8c9a25456d7605bdd8a71c9d7cf1cd71fe308587 (patch) | |
tree | 83091566b34f772d42f58b8afbd29670a0cc8255 /mesonbuild/backend | |
parent | ccc4ce28cc9077d77a0bc9e72b1177eba1be7186 (diff) | |
download | meson-8c9a25456d7605bdd8a71c9d7cf1cd71fe308587.zip meson-8c9a25456d7605bdd8a71c9d7cf1cd71fe308587.tar.gz meson-8c9a25456d7605bdd8a71c9d7cf1cd71fe308587.tar.bz2 |
Added custom_target[i] support for link_with and link_whole
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r-- | mesonbuild/backend/backends.py | 4 | ||||
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 4a4f7f4..072c7fb 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -171,6 +171,8 @@ class Backend: mlog.warning('custom_target {!r} has more than one output! ' 'Using the first one.'.format(t.name)) filename = t.get_outputs()[0] + elif isinstance(t, build.CustomTargetIndex): + filename = t.get_outputs()[0] else: assert(isinstance(t, build.BuildTarget)) filename = t.get_filename() @@ -214,7 +216,7 @@ class Backend: return os.path.join(self.get_target_dir(target), link_lib) elif isinstance(target, build.StaticLibrary): return os.path.join(self.get_target_dir(target), target.get_filename()) - elif isinstance(target, build.CustomTarget): + elif isinstance(target, build.CustomTarget) or isinstance(target, build.CustomTargetIndex): if not target.is_linkable_target(): raise MesonException('Tried to link against custom target "%s", which is not linkable.' % target.name) return os.path.join(self.get_target_dir(target), target.get_filename()) diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index d1bf1e5..da02f7a 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -249,9 +249,15 @@ class Vs2010Backend(backends.Backend): all_deps[d.get_id()] = d elif isinstance(target, build.BuildTarget): for ldep in target.link_targets: - all_deps[ldep.get_id()] = ldep + if isinstance(ldep, build.CustomTargetIndex): + all_deps[ldep.get_id()] = ldep.target + else: + all_deps[ldep.get_id()] = ldep for ldep in target.link_whole_targets: - all_deps[ldep.get_id()] = ldep + if isinstance(ldep, build.CustomTargetIndex): + all_deps[ldep.get_id()] = ldep.target + else: + all_deps[ldep.get_id()] = ldep for obj_id, objdep in self.get_obj_target_deps(target.objects): all_deps[obj_id] = objdep for gendep in target.get_generated_sources(): |