Some fixes for C++ cross compiler.

pull/15/head
Jussi Pakkanen 11 years ago
parent 696f72da1b
commit aa7b70efce
  1. 11
      environment.py

@ -310,7 +310,14 @@ class CPPCompiler(CCompiler):
pc.wait() pc.wait()
if pc.returncode != 0: if pc.returncode != 0:
raise EnvironmentException('Compiler %s can not compile programs.' % self.name_string()) raise EnvironmentException('Compiler %s can not compile programs.' % self.name_string())
pe = subprocess.Popen(binary_name) if self.is_cross:
if self.exe_wrapper is None:
# Can't check if the binaries run so we have to assume they do
return
cmdlist = self.exe_wrapper + [binary_name]
else:
cmdlist = [binary_name]
pe = subprocess.Popen(cmdlist)
pe.wait() pe.wait()
if pe.returncode != 0: if pe.returncode != 0:
raise EnvironmentException('Executables created by C++ compiler %s are not runnable.' % self.name_string()) raise EnvironmentException('Executables created by C++ compiler %s are not runnable.' % self.name_string())
@ -839,7 +846,7 @@ class Environment():
continue continue
out = p.communicate()[0] out = p.communicate()[0]
out = out.decode() out = out.decode()
if (out.startswith('c++ ') or out.startswith('g++') or 'GCC' in out) and \ if (out.startswith('c++ ') or 'g++' in out or 'GCC' in out) and \
'Free Software Foundation' in out: 'Free Software Foundation' in out:
return GnuCPPCompiler(ccache + [compiler], is_cross, exe_wrap) return GnuCPPCompiler(ccache + [compiler], is_cross, exe_wrap)
if 'apple' in out and 'Free Software Foundation' in out: if 'apple' in out and 'Free Software Foundation' in out:

Loading…
Cancel
Save