Skip to content

Commit

Permalink
swift: Implement get_dependency_link_args()
Browse files Browse the repository at this point in the history
In order to translate “-Wl” into “-Xlinker”.
  • Loading branch information
oleavr committed Apr 10, 2024
1 parent 2342473 commit f22f883
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mesonbuild/compilers/swift.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ def get_werror_args(self) -> T.List[str]:
def get_dependency_gen_args(self, outtarget: str, outfile: str) -> T.List[str]:
return ['-emit-dependencies']

def get_dependency_link_args(self, dep: 'Dependency') -> T.List[str]:
result = []
for arg in dep.get_link_args():
if arg.startswith("-Wl,"):
for flag in arg[4:].split(","):
result += ["-Xlinker", flag]
else:
result.append(arg)
return result

def depfile_for_object(self, objfile: str) -> T.Optional[str]:
return os.path.splitext(objfile)[0] + '.' + self.get_depfile_suffix()

Expand Down

0 comments on commit f22f883

Please sign in to comment.