integration/builder: Add Meson install/version check.

This commit is contained in:
Florent Kermarrec 2021-10-18 08:41:51 +02:00
parent f92a185109
commit 2a109c3a3e
1 changed files with 14 additions and 0 deletions

View File

@ -239,9 +239,23 @@ class Builder:
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.
meson_present = (shutil.which("meson") is not None)
meson_version = [0, 0, 0]
meson_major_min = 0
meson_minor_min = 59
if meson_present:
meson_version = subprocess.check_output(["meson", "-v"]).decode("utf-8").split(".")
if (not meson_present) or (int(meson_version[0]) < meson_major_min) or (int(meson_version[1]) < meson_minor_min):
msg = "Unable to find valid Meson build system, please install it with:\n"
msg += "- pip3 install meson.\n"
raise OSError(msg)
# Compile software package.
dst_dir = os.path.join(self.software_dir, name)
makefile = os.path.join(src_dir, "Makefile")