{bintools,cc}-wrapper: Factor out role accumulation logic

This commit is contained in:
John Ericson
2018-05-07 15:10:45 -04:00
parent 2110c0bd30
commit 8b0fce8cb1
7 changed files with 23 additions and 28 deletions
@@ -11,16 +11,7 @@ var_templates_bool=(
NIX+DONT_SET_RPATH
)
declare -a role_infixes=()
if [ "${NIX_BINTOOLS_WRAPPER_@infixSalt@_TARGET_BUILD:-}" ]; then
role_infixes+=(_BUILD_)
fi
if [ "${NIX_BINTOOLS_WRAPPER_@infixSalt@_TARGET_HOST:-}" ]; then
role_infixes+=(_)
fi
if [ "${NIX_BINTOOLS_WRAPPER_@infixSalt@_TARGET_TARGET:-}" ]; then
role_infixes+=(_TARGET_)
fi
accumulateRoles
for var in "${var_templates_list[@]}"; do
mangleVarList "$var" "${role_infixes[@]}"