build: fix linking libmpv when swift features are build

this was caused by commit 2e7a4f7. the LAST_LINKFLAGS were not added to
the linking of libmpv and that caused a linking error. manually add the
link flags the same way it's done when linking mpv.

Fixes #5968
This commit is contained in:
Akemi 2018-06-16 15:17:46 +02:00 committed by Jan Ekström
parent 4bf9a78b36
commit 93ec08cc7f
1 changed files with 14 additions and 7 deletions

View File

@ -28,18 +28,25 @@ def m_hook(self, node):
"""
return self.create_compiled_task('c', node)
def try_last_linkflags(cls):
try:
return cls.orig_run_str + ' ${LAST_LINKFLAGS}'
except AttributeError:
try:
return cls.hcode + ' ${LAST_LINKFLAGS}'
except TypeError:
return cls.hcode.decode('iso8859-1') + ' ${LAST_LINKFLAGS}'
def build(ctx):
from waflib import Task
cls = Task.classes['cprogram']
class cprogram(cls):
try:
run_str = cls.orig_run_str + ' ${LAST_LINKFLAGS}'
except AttributeError:
try:
run_str = cls.hcode + ' ${LAST_LINKFLAGS}'
except TypeError:
run_str = cls.hcode.decode('iso8859-1') + ' ${LAST_LINKFLAGS}'
run_str = try_last_linkflags(cls)
cls = Task.classes['cshlib']
class cshlib(cls):
run_str = try_last_linkflags(cls)
cls = Task.classes['macplist']
class macplist(cls):