Skip to content

Commit

Permalink
ninja: Add support for Swift shared library targets
Browse files Browse the repository at this point in the history
  • Loading branch information
oleavr committed Apr 9, 2024
1 parent cbbb6fe commit ef4f842
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mesonbuild/backend/ninjabackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2238,15 +2238,17 @@ def generate_swift_target(self, target):
elem = self.generate_link(target, self.get_target_filename(target),
rel_objects, self.build.static_linker[target.for_machine])
self.add_build(elem)
elif isinstance(target, build.Executable):
else:
elem = NinjaBuildElement(self.all_outputs, self.get_target_filename(target), rulename, [])
elem.add_dep(rel_objects)
elem.add_dep(link_deps)
elem.add_item('ARGS', link_args + swiftc.get_std_exe_link_args() + objects + abs_link_deps)
if isinstance(target, build.Executable):
link_args += swiftc.get_std_exe_link_args()
else:
link_args += swiftc.get_std_shared_lib_link_args()
elem.add_item('ARGS', link_args + objects + abs_link_deps)
elem.add_item('RUNDIR', rundir)
self.add_build(elem)
else:
raise MesonException('Swift supports only executable and static library targets.')
# Introspection information
self.create_target_source_introspection(target, swiftc, compile_args + header_imports + module_includes, relsrc, rel_generated)

Expand Down

0 comments on commit ef4f842

Please sign in to comment.