mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-22 09:57:15 +01:00
Processor detection improvement
This commit is contained in:
parent
a971973cde
commit
a29880d753
@ -169,7 +169,7 @@ class OptionsContext(Context.Context):
|
||||
count = int(os.sysconf('SC_NPROCESSORS_ONLN'))
|
||||
elif 'SC_NPROCESSORS_CONF' in os.sysconf_names:
|
||||
count = int(os.sysconf('SC_NPROCESSORS_CONF'))
|
||||
elif os.name not in ('nt', 'java'):
|
||||
if not count and os.name not in ('nt', 'java'):
|
||||
tmp = self.cmd_and_log(['sysctl', '-n', 'hw.ncpu'])
|
||||
if re.match('^[0-9]+$', tmp):
|
||||
count = int(tmp)
|
||||
|
Loading…
Reference in New Issue
Block a user