Merge pull request #2119 from long-pham/pr_useAllCPUCores

Utilizing all available CPU cores in the software make cmd
This commit is contained in:
enjoy-digital 2024-11-12 21:45:07 +01:00 committed by GitHub
commit 0f45ea221e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -317,8 +317,8 @@ class Builder:
def _generate_rom_software(self, compile_bios=True): def _generate_rom_software(self, compile_bios=True):
# Compile all software packages. # Compile all software packages.
for name, src_dir in self.software_packages: cpu_count = os.cpu_count()
for name, src_dir in self.software_packages:
# Skip BIOS compilation when disabled. # Skip BIOS compilation when disabled.
if name == "bios" and not compile_bios: if name == "bios" and not compile_bios:
continue continue
@ -326,7 +326,7 @@ class Builder:
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")
if self.compile_software: if self.compile_software:
subprocess.check_call(["make", "-C", dst_dir, "-f", makefile]) subprocess.check_call(["make", f"-j{cpu_count}", "-C", dst_dir, "-f", makefile])
def _initialize_rom_software(self): def _initialize_rom_software(self):
# Get BIOS data from compiled BIOS binary. # Get BIOS data from compiled BIOS binary.