Skip to content

Commit

Permalink
ninja: Add Swift compile args for dependencies
Browse files Browse the repository at this point in the history
Essential when using a modulemap to specify a C header, and needing the
include path to be set up correctly.
  • Loading branch information
oleavr committed Apr 9, 2024
1 parent 7c00ff9 commit 62a1ccc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mesonbuild/backend/ninjabackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2186,6 +2186,10 @@ def generate_swift_target(self, target):
if d.build is not None:
buildtreedir = os.path.normpath(os.path.join(self.environment.get_build_dir(), d.build))
compile_args += swiftc.get_include_args(buildtreedir, i.is_system)
for dep in reversed(target.get_external_deps()):
if not dep.found():
continue
compile_args += swiftc.get_dependency_compile_args(dep)
compile_args += target.get_extra_args('swift')
link_args = swiftc.get_output_args(os.path.join(self.environment.get_build_dir(), self.get_target_filename(target)))
link_args += self.build.get_project_link_args(swiftc, target.subproject, target.for_machine)
Expand Down

0 comments on commit 62a1ccc

Please sign in to comment.