diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-03-25 21:05:57 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-03-25 21:05:57 +0200 |
commit | 8e68f30e8f39fb53243f361de8f16f96fed78708 (patch) | |
tree | ccce200a7347f8ed50e7ebc14ec404178c094d94 /environment.py | |
parent | 06a69a6b1c020e348e7f0dc40ee65c4f187c3b2a (diff) | |
download | meson-8e68f30e8f39fb53243f361de8f16f96fed78708.zip meson-8e68f30e8f39fb53243f361de8f16f96fed78708.tar.gz meson-8e68f30e8f39fb53243f361de8f16f96fed78708.tar.bz2 |
Guard against nonexisting linker.
Diffstat (limited to 'environment.py')
-rwxr-xr-x | environment.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/environment.py b/environment.py index 8b98132..3eaaa52 100755 --- a/environment.py +++ b/environment.py @@ -349,10 +349,13 @@ class Environment(): if out.startswith('clang'): return ClangCXXCompiler(exelist) raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"') - + def detect_static_linker(self): exelist = self.get_static_linker_exelist() - p = subprocess.Popen(exelist + ['--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + try: + p = subprocess.Popen(exelist + ['--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + except OSError: + raise EnvironmentException('Could not execute static linker "%s".' % ' '.join(exelist)) (out, err) = p.communicate() out = out.decode() err = err.decode() |