From 4a79fe8d93e73345d8b0b7ea1f749972c76137db Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Sat, 30 Dec 2017 10:51:50 -0800 Subject: [PATCH] Factor out extra linker search dirs into new function. --- mesonbuild/dependencies/misc.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 567891058..926be5b94 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -390,14 +390,20 @@ class BoostDependency(ExternalDependency): args += self.lib_modules['boost_' + lib] return args + def extra_lib_dirs(self): + dirs = [] + if self.boost_root: + dirs= [ os.path.join(self.boost_root, 'lib')] + elif self.libdir: + dirs = [ self.libdir ] + return dirs + def get_link_args(self): if mesonlib.is_windows(): return self.get_win_link_args() args = [] - if self.boost_root: - args.append('-L' + os.path.join(self.boost_root, 'lib')) - elif self.libdir: - args.append('-L' + self.libdir) + for dir in self.extra_lib_dirs(): + args += ['-L' + dir] for lib in self.requested_modules: args += self.lib_modules['boost_' + lib] return args