From e7ceab751047c3c4a8e5b3fb714cd8203ae460dc Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Tue, 13 Apr 2021 16:52:43 +0300 Subject: Xcode: do not process custom target outputs on targets they are not used in. --- mesonbuild/backend/xcodebackend.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py index 96ad962..e40f712 100644 --- a/mesonbuild/backend/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -729,7 +729,10 @@ class XCodeBackend(backends.Backend): target_children = PbxArray() target_dict.add_item('children', target_children) target_children.add_item(target_src_map[tname], 'Source files') - target_dict.add_item('name', f'"{t}"') + if t.subproject: + target_dict.add_item('name', f'"{t.subproject} • {t}"') + else: + target_dict.add_item('name', f'"{t}"') target_dict.add_item('sourceTree', '""') source_files_dict = PbxDict() objects_dict.add_item(target_src_map[tname], source_files_dict, 'Source files') @@ -948,11 +951,12 @@ class XCodeBackend(backends.Backend): s = os.path.join(s.subdir, s.fname) if not self.environment.is_header(s): file_arr.add_item(self.buildfile_ids[(name, s)], os.path.join(self.environment.get_source_dir(), s)) - for tname, t in self.custom_targets.items(): - (srcs, ofilenames, cmd) = self.eval_custom_target_command(t) - for o in ofilenames: - file_arr.add_item(self.custom_target_output_buildfile[o], - os.path.join(self.environment.get_build_dir(), o)) + for gt in t.generated: + if isinstance(gt, build.CustomTarget): + (srcs, ofilenames, cmd) = self.eval_custom_target_command(gt) + for o in ofilenames: + file_arr.add_item(self.custom_target_output_buildfile[o], + os.path.join(self.environment.get_build_dir(), o)) phase_dict.add_item('runOnlyForDeploymentPostprocessing', 0) def generate_pbx_target_dependency(self, objects_dict): -- cgit v1.1