diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2021-04-22 20:00:16 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-04-23 17:29:29 +0300 |
commit | ee2363dbb733a3634d6cdbccf105aab36438a9ef (patch) | |
tree | 929c9d24bef31e6c64972cd20ff2a6ca6bfc8cd1 | |
parent | a2fd31f6c6584d34dcc76056a55f7e1a5be9682d (diff) | |
download | meson-ee2363dbb733a3634d6cdbccf105aab36438a9ef.zip meson-ee2363dbb733a3634d6cdbccf105aab36438a9ef.tar.gz meson-ee2363dbb733a3634d6cdbccf105aab36438a9ef.tar.bz2 |
Xcode: handle CustomTargetIndexes.
-rw-r--r-- | mesonbuild/backend/xcodebackend.py | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py index 9f72aee..68e174f 100644 --- a/mesonbuild/backend/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -1007,8 +1007,8 @@ class XCodeBackend(backends.Backend): for o in t.generated: if isinstance(o, build.CustomTarget): dep_array.add_item(self.pbx_custom_dep_map[o.get_id()], o.name) - if not isinstance(o, build.GeneratedList): - continue + elif isinstance(o, build.CustomTargetIndex): + dep_array.add_item(self.pbx_custom_dep_map[o.target.get_id()], o.target.name) generator_id += 1 @@ -1210,11 +1210,17 @@ class XCodeBackend(backends.Backend): for o in ofilenames: file_arr.add_item(self.custom_target_output_buildfile[o], os.path.join(self.environment.get_build_dir(), o)) + elif isinstance(gt, build.CustomTargetIndex): + for o in gt.get_outputs(): + file_arr.add_item(self.custom_target_output_buildfile[o], + os.path.join(self.environment.get_build_dir(), o)) elif isinstance(gt, build.GeneratedList): genfiles = self.generator_buildfile_ids[(name, generator_id)] generator_id += 1 for o in genfiles: file_arr.add_item(o) + else: + raise RuntimeError('Unknown input type: ' + str(gt)) phase_dict.add_item('runOnlyForDeploymentPostprocessing', 0) def generate_pbx_target_dependency(self, objects_dict): @@ -1375,10 +1381,18 @@ class XCodeBackend(backends.Backend): if o_abs.endswith('.o') or o_abs.endswith('.obj'): ldargs += [r'\"' + o_abs + r'\"'] else: - (srcs, ofilenames, cmd) = self.eval_custom_target_command(o) - for ofname in ofilenames: - if os.path.splitext(ofname)[-1] in LINKABLE_EXTENSIONS: - ldargs += [r'\"' + os.path.join(self.environment.get_build_dir(), ofname) + r'\"'] + if isinstance(o, build.CustomTarget): + (srcs, ofilenames, cmd) = self.eval_custom_target_command(o) + for ofname in ofilenames: + if os.path.splitext(ofname)[-1] in LINKABLE_EXTENSIONS: + ldargs += [r'\"' + os.path.join(self.environment.get_build_dir(), ofname) + r'\"'] + elif isinstance(o, build.CustomTargetIndex): + for ofname in o.get_outputs(): + if os.path.splitext(ofname)[-1] in LINKABLE_EXTENSIONS: + ldargs += [r'\"' + os.path.join(self.environment.get_build_dir(), ofname) + r'\"'] + + else: + raise RuntimeError(o) if isinstance(target, build.SharedModule): options = self.environment.coredata.options ldargs += linker.get_std_shared_module_link_args(options) |