builder: Move Meson check to _check_meson and only do it when using BIOS.
This commit is contained in:
parent
2a109c3a3e
commit
467c1b9b88
|
@ -231,19 +231,7 @@ class Builder:
|
||||||
csr_svd_contents = export.get_csr_svd(self.soc)
|
csr_svd_contents = export.get_csr_svd(self.soc)
|
||||||
write_to_file(os.path.realpath(self.csr_svd), csr_svd_contents)
|
write_to_file(os.path.realpath(self.csr_svd), csr_svd_contents)
|
||||||
|
|
||||||
def _prepare_rom_software(self):
|
def _check_meson(self):
|
||||||
# Create directories for all software packages.
|
|
||||||
for name, src_dir in self.software_packages:
|
|
||||||
_create_dir(os.path.join(self.software_dir, name))
|
|
||||||
|
|
||||||
def _generate_rom_software(self, compile_bios=True):
|
|
||||||
# Compile all software packages.
|
|
||||||
for name, src_dir in self.software_packages:
|
|
||||||
|
|
||||||
# Skip BIOS compilation when disabled.
|
|
||||||
if name == "bios" and not compile_bios:
|
|
||||||
continue
|
|
||||||
|
|
||||||
# Check Meson install/version.
|
# Check Meson install/version.
|
||||||
meson_present = (shutil.which("meson") is not None)
|
meson_present = (shutil.which("meson") is not None)
|
||||||
meson_version = [0, 0, 0]
|
meson_version = [0, 0, 0]
|
||||||
|
@ -256,6 +244,18 @@ class Builder:
|
||||||
msg += "- pip3 install meson.\n"
|
msg += "- pip3 install meson.\n"
|
||||||
raise OSError(msg)
|
raise OSError(msg)
|
||||||
|
|
||||||
|
def _prepare_rom_software(self):
|
||||||
|
# Create directories for all software packages.
|
||||||
|
for name, src_dir in self.software_packages:
|
||||||
|
_create_dir(os.path.join(self.software_dir, name))
|
||||||
|
|
||||||
|
def _generate_rom_software(self, compile_bios=True):
|
||||||
|
# Compile all software packages.
|
||||||
|
for name, src_dir in self.software_packages:
|
||||||
|
|
||||||
|
# Skip BIOS compilation when disabled.
|
||||||
|
if name == "bios" and not compile_bios:
|
||||||
|
continue
|
||||||
# Compile software package.
|
# Compile software package.
|
||||||
dst_dir = os.path.join(self.software_dir, name)
|
dst_dir = os.path.join(self.software_dir, name)
|
||||||
makefile = os.path.join(src_dir, "Makefile")
|
makefile = os.path.join(src_dir, "Makefile")
|
||||||
|
@ -314,6 +314,7 @@ class Builder:
|
||||||
)
|
)
|
||||||
if use_bios:
|
if use_bios:
|
||||||
self.soc.check_bios_requirements()
|
self.soc.check_bios_requirements()
|
||||||
|
self._check_meson()
|
||||||
self._prepare_rom_software()
|
self._prepare_rom_software()
|
||||||
self._generate_rom_software(compile_bios=use_bios)
|
self._generate_rom_software(compile_bios=use_bios)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue