Fix windows tests when using newer MinGW.

pull/102/head
Jussi Pakkanen 10 years ago
parent 7df7b62ee7
commit a92fcb711b
  1. 2
      environment.py
  2. 8
      run_tests.py

@ -77,7 +77,7 @@ class Environment():
# List of potential compilers. # List of potential compilers.
if mesonlib.is_windows(): if mesonlib.is_windows():
self.default_c = ['cl', 'cc'] self.default_c = ['cl', 'cc', 'gcc']
self.default_cpp = ['cl', 'c++'] self.default_cpp = ['cl', 'c++']
else: else:
self.default_c = ['cc'] self.default_c = ['cc']

@ -288,7 +288,13 @@ def generate_prebuilt_object():
objectfile = objectbase + 'obj' objectfile = objectbase + 'obj'
else: else:
objectfile = objectbase + 'o' 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) subprocess.check_call(cmd)
return objectfile return objectfile

Loading…
Cancel
Save