diff options
author | Jeff Moguillansky <jmoguillansky@gopro.com> | 2021-01-29 14:58:23 -0800 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-01-30 11:30:56 +0000 |
commit | 4f8cecca9733588b083dba8488143fa1ffb0e495 (patch) | |
tree | ac8976f71dbd5297f24b817eb22e9c313b6954b0 /mesonbuild/build.py | |
parent | c67e0a8a6785ab5f139491786fa064905278d951 (diff) | |
download | meson-4f8cecca9733588b083dba8488143fa1ffb0e495.zip meson-4f8cecca9733588b083dba8488143fa1ffb0e495.tar.gz meson-4f8cecca9733588b083dba8488143fa1ffb0e495.tar.bz2 |
build: add function get_build_targets to Build class
Add function to Build class to get targets of type BuildTarget
Update xcode backend to call get_build_targets when iterating over targets.
This resolves crash in xcode backend when using custom targets:
AttributeError: ‘CustomTarget’ object has no attribute ‘objects’
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 32daf54..36bce1c 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -223,6 +223,13 @@ class Build: self.searched_programs = set() # The list of all programs that have been searched for. self.dependency_overrides = PerMachine({}, {}) + def get_build_targets(self): + build_targets = OrderedDict() + for name, t in self.targets.items(): + if isinstance(t, BuildTarget): + build_targets[name] = t + return build_targets + def copy(self): other = Build(self.environment) for k, v in self.__dict__.items(): |