diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-10-23 18:46:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-23 18:46:40 +0200 |
commit | cc4a9bcf35eafb56a48545b700b064c2231d48f2 (patch) | |
tree | ccc17381b0368b2c0ace11c7d1a864f0a1221e1e /mesonbuild/environment.py | |
parent | 562c50f229cfe0a28abdfc2c56360f5a82c83b57 (diff) | |
parent | 9262236322140f0b2cb94a53baeb67188c247f59 (diff) | |
download | meson-cc4a9bcf35eafb56a48545b700b064c2231d48f2.zip meson-cc4a9bcf35eafb56a48545b700b064c2231d48f2.tar.gz meson-cc4a9bcf35eafb56a48545b700b064c2231d48f2.tar.bz2 |
Merge pull request #2516 from dcbaker/submit/llvm-fix-lib-path
LLVM: Don't add -L<system path> to link args
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 2f33a03..a746cab 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -887,6 +887,24 @@ class Environment: def get_datadir(self): return self.coredata.get_builtin_option('datadir') + def get_compiler_system_dirs(self): + for comp in self.coredata.compilers.values(): + if isinstance(comp, compilers.ClangCompiler): + index = 1 + break + elif isinstance(comp, compilers.GnuCompiler): + index = 2 + break + else: + # This option is only supported by gcc and clang. If we don't get a + # GCC or Clang compiler return and empty list. + return [] + + p, out, _ = Popen_safe(comp.get_exelist() + ['-print-search-dirs']) + if p.returncode != 0: + raise mesonlib.MesonException('Could not calculate system search dirs') + out = out.split('\n')[index].lstrip('libraries: =').split(':') + return [os.path.normpath(p) for p in out] def get_args_from_envvars(compiler): """ |