Skip to content

Commit

Permalink
Xcode backend: only use found appleframeworksn
Browse files Browse the repository at this point in the history
Add a check before using an `appleframeworks` to make sure it was found.
This fixes an exception in meson while encountering an optional dep for
the target.
  • Loading branch information
klokik authored and dcbaker committed Nov 4, 2024
1 parent 040c8d0 commit 273894d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mesonbuild/backend/xcodebackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ def generate_native_frameworks_map(self) -> None:
self.native_frameworks_fileref = {}
for t in self.build_targets.values():
for dep in t.get_external_deps():
if dep.name == 'appleframeworks':
if dep.name == 'appleframeworks' and dep.found():
for f in dep.frameworks:
self.native_frameworks[f] = self.gen_id()
self.native_frameworks_fileref[f] = self.gen_id()
Expand Down Expand Up @@ -691,7 +691,7 @@ def generate_pbx_aggregate_target(self, objects_dict: PbxDict) -> None:
def generate_pbx_build_file(self, objects_dict: PbxDict) -> None:
for tname, t in self.build_targets.items():
for dep in t.get_external_deps():
if dep.name == 'appleframeworks':
if dep.name == 'appleframeworks' and dep.found():
for f in dep.frameworks:
fw_dict = PbxDict()
fwkey = self.native_frameworks[f]
Expand Down Expand Up @@ -848,7 +848,7 @@ def generate_pbx_container_item_proxy(self, objects_dict: PbxDict) -> None:
def generate_pbx_file_reference(self, objects_dict: PbxDict) -> None:
for tname, t in self.build_targets.items():
for dep in t.get_external_deps():
if dep.name == 'appleframeworks':
if dep.name == 'appleframeworks' and dep.found():
for f in dep.frameworks:
fw_dict = PbxDict()
framework_fileref = self.native_frameworks_fileref[f]
Expand Down Expand Up @@ -1023,7 +1023,7 @@ def generate_pbx_frameworks_buildphase(self, objects_dict: PbxDict) -> None:
file_list = PbxArray()
bt_dict.add_item('files', file_list)
for dep in t.get_external_deps():
if dep.name == 'appleframeworks':
if dep.name == 'appleframeworks' and dep.found():
for f in dep.frameworks:
file_list.add_item(self.native_frameworks[f], f'{f}.framework in Frameworks')
bt_dict.add_item('runOnlyForDeploymentPostprocessing', 0)
Expand Down Expand Up @@ -1071,7 +1071,7 @@ def generate_pbx_group(self, objects_dict: PbxDict) -> None:

for t in self.build_targets.values():
for dep in t.get_external_deps():
if dep.name == 'appleframeworks':
if dep.name == 'appleframeworks' and dep.found():
for f in dep.frameworks:
frameworks_children.add_item(self.native_frameworks_fileref[f], f)

Expand Down

0 comments on commit 273894d

Please sign in to comment.