From 93ec08cc7f2122f365469d8eb82b9bfbdbb2c4f8 Mon Sep 17 00:00:00 2001 From: Akemi Date: Sat, 16 Jun 2018 15:17:46 +0200 Subject: 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 --- waftools/waf_customizations.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'waftools') diff --git a/waftools/waf_customizations.py b/waftools/waf_customizations.py index f264f9cb86..f0db04c614 100644 --- a/waftools/waf_customizations.py +++ b/waftools/waf_customizations.py @@ -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): -- cgit v1.2.3