From f7d99ae0dc97c00c1690863881709b7a8b89bb40 Mon Sep 17 00:00:00 2001 From: avkarenow Date: Thu, 12 Oct 2023 01:39:48 +0200 Subject: [PATCH] Make use of CMAKE_BUILD_PARALLEL_LEVEL (#2879) --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c32c210e2..219583b1f 100644 --- a/setup.py +++ b/setup.py @@ -173,7 +173,9 @@ def num_available_cpu_cores(ram_per_build_process_in_gb): if 'TRAVIS' in os.environ and os.environ['TRAVIS']=='true': # When building on travis-ci, just use 2 cores since travis-ci limits # you to that regardless of what the hardware might suggest. - return 2 + return 2 + elif 'CMAKE_BUILD_PARALLEL_LEVEL' in os.environ and os.environ['CMAKE_BUILD_PARALLEL_LEVEL'].isnumeric(): + return int(os.environ['CMAKE_BUILD_PARALLEL_LEVEL']) try: mem_bytes = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') mem_gib = mem_bytes/(1024.**3)