From ad0121d259c2155e81b5eb75ef40ace47e5244f8 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sun, 3 Jun 2018 18:10:54 +0530 Subject: Add prog/lib dirs from the mingw cross-compiler to PATH These directories contain DLLs that the executable may need, such as libstdc++-6.dll, libwinpthread, etc. --- mesonbuild/compilers/compilers.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'mesonbuild/compilers/compilers.py') diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index c5f7df3..9bd9bb2 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -1172,13 +1172,27 @@ class ElbrusCompiler(GnuCompiler): env = os.environ.copy() env['LC_ALL'] = 'C' stdo = Popen_safe(self.exelist + ['--print-search-dirs'], env=env)[1] + paths = [] for line in stdo.split('\n'): if line.startswith('libraries:'): # lcc does not include '=' in --print-search-dirs output. libstr = line.split(' ', 1)[1] - return libstr.split(':') - return [] + paths = [os.path.realpath(p) for p in libstr.split(':')] + break + return paths + def get_program_dirs(self): + env = os.environ.copy() + env['LC_ALL'] = 'C' + stdo = Popen_safe(self.exelist + ['--print-search-dirs'], env=env)[1] + paths = [] + for line in stdo.split('\n'): + if line.startswith('programs:'): + # lcc does not include '=' in --print-search-dirs output. + libstr = line.split(' ', 1)[1] + paths = [os.path.realpath(p) for p in libstr.split(':')] + break + return paths class ClangCompiler: -- cgit v1.1