Build with all cpu cores by default (#2336)

This commit is contained in:
Cheng
2025-07-07 22:06:45 +09:00
committed by GitHub
parent f5299f72cd
commit 19facd4b20
4 changed files with 13 additions and 35 deletions

View File

@@ -97,11 +97,7 @@ class CMakeBuild(build_ext):
# Set CMAKE_BUILD_PARALLEL_LEVEL to control the parallel build level
# across all generators.
if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ:
# self.parallel is a Python 3 only way to set parallel jobs by hand
# using -j in the build_ext call, not supported by pip or PyPA-build.
if hasattr(self, "parallel") and self.parallel:
# CMake 3.12+ only.
build_args += [f"-j{self.parallel}"]
build_args += [f"-j{os.cpu_count()}"]
build_temp = Path(self.build_temp) / ext.name
if not build_temp.exists():