2
0
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:
ita 2011-09-30 16:45:11 +02:00
parent a971973cde
commit a29880d753

View File

@ -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)