[CI/Build] CMakeLists: build all extensions' cmake targets at the same time (#5034)

This commit is contained in:
Daniele 2024-06-01 06:06:45 +02:00 committed by GitHub
parent 1197e02141
commit a360ff80bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -187,19 +187,22 @@ class cmake_build_ext(build_ext):
if not os.path.exists(self.build_temp):
os.makedirs(self.build_temp)
targets = []
# Build all the extensions
for ext in self.extensions:
self.configure(ext)
targets.append(remove_prefix(ext.name, "vllm."))
ext_target_name = remove_prefix(ext.name, "vllm.")
num_jobs, _ = self.compute_num_jobs()
num_jobs, _ = self.compute_num_jobs()
build_args = [
'--build', '.', '--target', ext_target_name, '-j',
str(num_jobs)
]
build_args = [
"--build",
".",
f"-j={num_jobs}",
*[f"--target={name}" for name in targets],
]
subprocess.check_call(['cmake', *build_args], cwd=self.build_temp)
subprocess.check_call(["cmake", *build_args], cwd=self.build_temp)
def _is_cuda() -> bool: