diff options
| author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-04-20 22:04:58 +0300 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-04-20 22:04:58 +0300 |
| commit | a92fcb711b5b56ee6858d73dc90eda0e1e5d91a4 (patch) | |
| tree | 66bafc02688a61e7c30dfcd78398a2d27d525082 | |
| parent | 7df7b62ee797b2c010616b43982f23cb259b1655 (diff) | |
| download | meson-a92fcb711b5b56ee6858d73dc90eda0e1e5d91a4.tar.gz | |
Fix windows tests when using newer MinGW.
| -rw-r--r-- | environment.py | 2 | ||||
| -rwxr-xr-x | run_tests.py | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/environment.py b/environment.py index 8c873b669..08256c4aa 100644 --- a/environment.py +++ b/environment.py @@ -77,7 +77,7 @@ class Environment(): # List of potential compilers. if mesonlib.is_windows(): - self.default_c = ['cl', 'cc'] + self.default_c = ['cl', 'cc', 'gcc'] self.default_cpp = ['cl', 'c++'] else: self.default_c = ['cc'] diff --git a/run_tests.py b/run_tests.py index 79c17cd20..69898e7ed 100755 --- a/run_tests.py +++ b/run_tests.py @@ -288,7 +288,13 @@ def generate_prebuilt_object(): objectfile = objectbase + 'obj' else: objectfile = objectbase + 'o' - cmd = ['cc', '-c', source, '-o', objectfile] + if shutil.which('cc'): + cmd = 'cc' + elif shutil.which('gcc'): + cmd = 'gcc' + else: + raise RuntimeError("Could not find C compiler.") + cmd = [cmd, '-c', source, '-o', objectfile] subprocess.check_call(cmd) return objectfile |
