mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
utils.py: add parallel make helpers
The code to extract the integer number of parallel build threads and construct a new argument from them has started to be copied in multiple locations, so create two new helper utilities to aid recipes. The first helper (parallel_make()) extracts the integer number of parallel build threads from PARALLEL_MAKE. The second (parallel_make_argument()) does the same and then puts the result back into a format string, optionally clamping it to some maximum value. Additionally, rework the oe-core recipes that were manually doing this to use the new helper utilities. (From OE-Core rev: ccd1142d22b31ed85d8823b1bc9e11ccfd72b61f) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
c723f7c92a
commit
feded5fe27
+1
-18
@@ -1,23 +1,6 @@
|
||||
inherit goarch ptest
|
||||
|
||||
def get_go_parallel_make(d):
|
||||
pm = (d.getVar('PARALLEL_MAKE') or '').split()
|
||||
# look for '-j' and throw other options (e.g. '-l') away
|
||||
# because they might have a different meaning in golang
|
||||
while pm:
|
||||
opt = pm.pop(0)
|
||||
if opt == '-j':
|
||||
v = pm.pop(0)
|
||||
elif opt.startswith('-j'):
|
||||
v = opt[2:].strip()
|
||||
else:
|
||||
continue
|
||||
|
||||
return '-p %d' % int(v)
|
||||
|
||||
return ""
|
||||
|
||||
GO_PARALLEL_BUILD ?= "${@get_go_parallel_make(d)}"
|
||||
GO_PARALLEL_BUILD ?= "${@oe.utils.parallel_make_argument(d, '-p %d')}"
|
||||
|
||||
GOROOT_class-native = "${STAGING_LIBDIR_NATIVE}/go"
|
||||
GOROOT_class-nativesdk = "${STAGING_DIR_TARGET}${libdir}/go"
|
||||
|
||||
Reference in New Issue
Block a user