Skip to content

Commit 5386d05

Browse files
committed
packages - added the ability to set a package section based on platform flags
The module/package variable rp_module_section used to need a single string containing the section for the module - eg "core" "main" "opt". With this change, you can provide additional space separated parameters to specify the section for a specific platform flag. This is useful for example to have a module by default in "opt", but then promote it to "main" for certain systems. eg for mame4all (mostly useful for slower armv6 devices) you could do rp_module_section="opt armv6=main" which would place it in the main section only for armv6
1 parent 7d0b726 commit 5386d05

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

scriptmodules/packages.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,19 @@ function rp_registerModule() {
400400
fi
401401
done
402402
403+
local sections=($rp_module_section)
404+
# get default section
405+
rp_module_section="${sections[0]}"
406+
407+
# loop through any additional flag=section parameters
408+
local flag section
409+
for section in "${sections[@]:1}"; do
410+
section=(${section/=/ })
411+
flag="${section[0]}"
412+
section="${section[1]}"
413+
isPlatform "$flag" && rp_module_section="$section"
414+
done
415+
403416
if [[ "$valid" -eq 1 ]]; then
404417
__mod_idx+=("$module_idx")
405418
__mod_id["$module_idx"]="$rp_module_id"

0 commit comments

Comments
 (0)