@@ -539,8 +539,7 @@ def xenv_PKG_CONFIG_PATH(self):
539539 yield f"{ self .deps_lib } /pkgconfig"
540540
541541 def _do_run (self , program , * args , fatal = True , env = None ):
542- logger = self ._log_handler
543- return runez .run (program , * args , passthrough = logger , stdout = None , stderr = None , fatal = fatal , env = env , logger = logger or runez .UNSET )
542+ return runez .run (program , * args , passthrough = self ._log_handler , stdout = None , stderr = None , fatal = fatal , env = env )
544543
545544 def run_configure (self , program , * args , prefix = None ):
546545 """
@@ -558,11 +557,13 @@ def run_configure(self, program, *args, prefix=None):
558557
559558 def run_make (self , * args , program = "make" , cpu_count = None ):
560559 cmd = program .split ()
561- if cpu_count is None :
562- cpu_count = multiprocessing .cpu_count ()
560+ if cpu_count and cpu_count < 0 :
561+ available = multiprocessing .cpu_count ()
562+ if available and available > 0 :
563+ cpu_count += available
563564
564- if cpu_count and cpu_count > 3 :
565- cmd .append ("-j%s" % ( cpu_count - 2 ) )
565+ if cpu_count and cpu_count > 1 :
566+ cmd .append ("-j%s" % cpu_count )
566567
567568 self ._do_run (* cmd , * args )
568569
0 commit comments