summaryrefslogtreecommitdiffstats
path: root/lib/bb/command.py
diff options
context:
space:
mode:
authorShane Wang <shane.wang@intel.com>2012-02-23 21:47:19 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-23 22:45:58 +0000
commit335047b2e440e65713e88fabb24b47a9c82f939b (patch)
tree50e6d01d0c65600b271437d16d4323873033ccb8 /lib/bb/command.py
parentc8e19c5c389efc06696084c6f9439ba75472c5b7 (diff)
downloadbitbake-335047b2e440e65713e88fabb24b47a9c82f939b.tar.gz
command.py: add new API to get the cpu count on the server
Add a new API in command.py to get the cpu count in order to set the appropriate default BB_NUMBER_THREADS and PARALLEL_MAKE variables. Signed-off-by: Shane Wang <shane.wang@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/command.py')
-rw-r--r--lib/bb/command.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/bb/command.py b/lib/bb/command.py
index 2a3a3afac..4e9e8d657 100644
--- a/lib/bb/command.py
+++ b/lib/bb/command.py
@@ -173,6 +173,12 @@ class CommandsSync:
"""
command.cooker.reset()
+ def getCpuCount(self, command, params):
+ """
+ Get the CPU count on the bitbake server
+ """
+ return bb.utils.cpu_count()
+
class CommandsAsync:
"""