soc/integration/cpu_interface: don't raise OSError if we are not going to compile software and compilation toolchain is not found

This commit is contained in:
Florent Kermarrec 2019-09-11 18:30:28 +02:00
parent 62f53d5035
commit 16b6b357ca
2 changed files with 4 additions and 2 deletions

View File

@ -80,7 +80,7 @@ class Builder:
variables_contents = []
def define(k, v):
variables_contents.append("{}={}\n".format(k, _makefile_escape(v)))
for k, v in cpu_interface.get_cpu_mak(self.soc.cpu):
for k, v in cpu_interface.get_cpu_mak(self.soc.cpu, self.compile_software):
define(k, v)
# Distinguish between LiteX and MiSoC.
define("LITEX", "1")

View File

@ -30,7 +30,7 @@ def get_constant(name, constants):
return v
return None
def get_cpu_mak(cpu):
def get_cpu_mak(cpu, compile_software):
# select between clang and gcc
clang = os.getenv("CLANG", "")
if clang != "":
@ -70,6 +70,8 @@ def get_cpu_mak(cpu):
r = t
break
if r is None:
if not compile_software:
return "--not-found--"
msg = "Unable to find any of the cross compilation toolchains:\n"
for i in range(len(triple)):
msg += "- " + triple[i] + "\n"