|
@@ -974,11 +974,12 @@ _get_option_item() {
|
|
_set_option_item() {
|
|
_set_option_item() {
|
|
local name=${1}
|
|
local name=${1}
|
|
local key=${2}
|
|
local key=${2}
|
|
- local value=${3}
|
|
|
|
|
|
+ shift
|
|
|
|
+ shift
|
|
if test_nz "${name}"; then
|
|
if test_nz "${name}"; then
|
|
- _map_set "options" "${name}_${key}" "${value}"
|
|
|
|
|
|
+ _map_set "options" "${name}_${key}" "${@}"
|
|
else
|
|
else
|
|
- raise "please call set_${key}(${value}) in the option scope!"
|
|
|
|
|
|
+ raise "please call set_${key}(${@}) in the option scope!"
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
|
|
@@ -986,13 +987,14 @@ _set_option_item() {
|
|
_add_option_item() {
|
|
_add_option_item() {
|
|
local name=${1}
|
|
local name=${1}
|
|
local key=${2}
|
|
local key=${2}
|
|
- local value=${3}
|
|
|
|
|
|
+ shift
|
|
|
|
+ shift
|
|
if test_nz "${name}"; then
|
|
if test_nz "${name}"; then
|
|
_map_get "options" "${name}_${key}"; local values="${_ret}"
|
|
_map_get "options" "${name}_${key}"; local values="${_ret}"
|
|
- values="${values} ${value}"
|
|
|
|
|
|
+ values="${values} ${@}"
|
|
_map_set "options" "${name}_${key}" "${values}"
|
|
_map_set "options" "${name}_${key}" "${values}"
|
|
else
|
|
else
|
|
- raise "please call add_${key}(${value}) in the option scope!"
|
|
|
|
|
|
+ raise "please call add_${key}(${@}) in the option scope!"
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1155,10 +1157,7 @@ add_cincludes() {
|
|
if ! ${_loading_options}; then
|
|
if ! ${_loading_options}; then
|
|
return
|
|
return
|
|
fi
|
|
fi
|
|
- local cinclude=""
|
|
|
|
- for cinclude in $@; do
|
|
|
|
- _add_option_item "${_xmake_sh_option_current}" "cincludes" "${cinclude}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_option_item "${_xmake_sh_option_current}" "cincludes" "${@}"
|
|
}
|
|
}
|
|
|
|
|
|
# add cxxincludes in option
|
|
# add cxxincludes in option
|
|
@@ -1166,10 +1165,7 @@ add_cxxincludes() {
|
|
if ! ${_loading_options}; then
|
|
if ! ${_loading_options}; then
|
|
return
|
|
return
|
|
fi
|
|
fi
|
|
- local cxxinclude=""
|
|
|
|
- for cxxinclude in $@; do
|
|
|
|
- _add_option_item "${_xmake_sh_option_current}" "cxxincludes" "${cxxinclude}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_option_item "${_xmake_sh_option_current}" "cxxincludes" "${@}"
|
|
}
|
|
}
|
|
|
|
|
|
# add ctypes in option
|
|
# add ctypes in option
|
|
@@ -1177,10 +1173,7 @@ add_ctypes() {
|
|
if ! ${_loading_options}; then
|
|
if ! ${_loading_options}; then
|
|
return
|
|
return
|
|
fi
|
|
fi
|
|
- local ctype=""
|
|
|
|
- for ctype in $@; do
|
|
|
|
- _add_option_item "${_xmake_sh_option_current}" "ctypes" "${ctype}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_option_item "${_xmake_sh_option_current}" "ctypes" "${@}"
|
|
}
|
|
}
|
|
|
|
|
|
# add cxxtypes in option
|
|
# add cxxtypes in option
|
|
@@ -1188,10 +1181,7 @@ add_cxxtypes() {
|
|
if ! ${_loading_options}; then
|
|
if ! ${_loading_options}; then
|
|
return
|
|
return
|
|
fi
|
|
fi
|
|
- local cxxtype=""
|
|
|
|
- for cxxtype in $@; do
|
|
|
|
- _add_option_item "${_xmake_sh_option_current}" "cxxtypes" "${cxxtype}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_option_item "${_xmake_sh_option_current}" "cxxtypes" "${@}"
|
|
}
|
|
}
|
|
|
|
|
|
# add csnippets in option
|
|
# add csnippets in option
|
|
@@ -1285,11 +1275,12 @@ _get_target_item() {
|
|
_set_target_item() {
|
|
_set_target_item() {
|
|
local name=${1}
|
|
local name=${1}
|
|
local key=${2}
|
|
local key=${2}
|
|
- local value=${3}
|
|
|
|
|
|
+ shift
|
|
|
|
+ shift
|
|
if test_nz "${name}"; then
|
|
if test_nz "${name}"; then
|
|
- _map_set "targets" "${name}_${key}" "${value}"
|
|
|
|
|
|
+ _map_set "targets" "${name}_${key}" "${@}"
|
|
else
|
|
else
|
|
- _map_set "targets" "__root_${key}" "${value}"
|
|
|
|
|
|
+ _map_set "targets" "__root_${key}" "${@}"
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1297,14 +1288,15 @@ _set_target_item() {
|
|
_add_target_item() {
|
|
_add_target_item() {
|
|
local name=${1}
|
|
local name=${1}
|
|
local key=${2}
|
|
local key=${2}
|
|
- local value=${3}
|
|
|
|
|
|
+ shift
|
|
|
|
+ shift
|
|
if test_nz "${name}"; then
|
|
if test_nz "${name}"; then
|
|
_map_get "targets" "${name}_${key}"; local values="${_ret}"
|
|
_map_get "targets" "${name}_${key}"; local values="${_ret}"
|
|
- values="${values} ${value}"
|
|
|
|
|
|
+ values="${values} ${@}"
|
|
_map_set "targets" "${name}_${key}" "${values}"
|
|
_map_set "targets" "${name}_${key}" "${values}"
|
|
else
|
|
else
|
|
_map_get "targets" "__root_${key}"; local values="${_ret}"
|
|
_map_get "targets" "__root_${key}"; local values="${_ret}"
|
|
- values="${values} ${value}"
|
|
|
|
|
|
+ values="${values} ${@}"
|
|
_map_set "targets" "__root_${key}" "${values}"
|
|
_map_set "targets" "__root_${key}" "${values}"
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
@@ -1929,10 +1921,7 @@ add_deps() {
|
|
if ! ${_loading_targets}; then
|
|
if ! ${_loading_targets}; then
|
|
return
|
|
return
|
|
fi
|
|
fi
|
|
- local dep=""
|
|
|
|
- for dep in $@; do
|
|
|
|
- _add_target_item "${_xmake_sh_target_current}" "deps" "${dep}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_target_item "${_xmake_sh_target_current}" "deps" "${@}"
|
|
}
|
|
}
|
|
|
|
|
|
# add files in target
|
|
# add files in target
|
|
@@ -1987,9 +1976,7 @@ add_defines() {
|
|
done
|
|
done
|
|
fi
|
|
fi
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
- for define in $@; do
|
|
|
|
- _add_option_item "${_xmake_sh_option_current}" "defines" "${define}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_option_item "${_xmake_sh_option_current}" "defines" "${@}"
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2013,9 +2000,7 @@ add_udefines() {
|
|
done
|
|
done
|
|
fi
|
|
fi
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
- for udefine in $@; do
|
|
|
|
- _add_option_item "${_xmake_sh_option_current}" "udefines" "${udefine}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_option_item "${_xmake_sh_option_current}" "udefines" "${@}"
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2077,9 +2062,7 @@ add_links() {
|
|
done
|
|
done
|
|
fi
|
|
fi
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
- for link in $@; do
|
|
|
|
- _add_option_item "${_xmake_sh_option_current}" "links" "${link}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_option_item "${_xmake_sh_option_current}" "links" "${@}"
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2103,9 +2086,7 @@ add_syslinks() {
|
|
done
|
|
done
|
|
fi
|
|
fi
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
- for syslink in $@; do
|
|
|
|
- _add_option_item "${_xmake_sh_option_current}" "syslinks" "${syslink}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_option_item "${_xmake_sh_option_current}" "syslinks" "${@}"
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2182,9 +2163,7 @@ add_frameworks() {
|
|
done
|
|
done
|
|
fi
|
|
fi
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
- for framework in $@; do
|
|
|
|
- _add_option_item "${_xmake_sh_option_current}" "frameworks" "${framework}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_option_item "${_xmake_sh_option_current}" "frameworks" "${@}"
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2234,63 +2213,46 @@ set_languages() {
|
|
|
|
|
|
# set warnings in target
|
|
# set warnings in target
|
|
set_warnings() {
|
|
set_warnings() {
|
|
- local warnings="${@}"
|
|
|
|
if ${_loading_targets} && test_z "${_xmake_sh_option_current}"; then
|
|
if ${_loading_targets} && test_z "${_xmake_sh_option_current}"; then
|
|
- _set_target_item "${_xmake_sh_target_current}" "warnings" "${warnings}"
|
|
|
|
|
|
+ _set_target_item "${_xmake_sh_target_current}" "warnings" "${@}"
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
- _set_option_item "${_xmake_sh_option_current}" "warnings" "${warnings}"
|
|
|
|
|
|
+ _set_option_item "${_xmake_sh_option_current}" "warnings" "${@}"
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
|
|
# set optimizes in target
|
|
# set optimizes in target
|
|
set_optimizes() {
|
|
set_optimizes() {
|
|
- local optimizes="${@}"
|
|
|
|
if ${_loading_targets} && test_z "${_xmake_sh_option_current}"; then
|
|
if ${_loading_targets} && test_z "${_xmake_sh_option_current}"; then
|
|
- _set_target_item "${_xmake_sh_target_current}" "optimizes" "${optimizes}"
|
|
|
|
|
|
+ _set_target_item "${_xmake_sh_target_current}" "optimizes" "${@}"
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
- _set_option_item "${_xmake_sh_option_current}" "optimizes" "${optimizes}"
|
|
|
|
|
|
+ _set_option_item "${_xmake_sh_option_current}" "optimizes" "${@}"
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
|
|
# add cflags in target
|
|
# add cflags in target
|
|
add_cflags() {
|
|
add_cflags() {
|
|
- local flag=""
|
|
|
|
if ${_loading_targets} && test_z "${_xmake_sh_option_current}"; then
|
|
if ${_loading_targets} && test_z "${_xmake_sh_option_current}"; then
|
|
- for flag in $@; do
|
|
|
|
- _add_target_item "${_xmake_sh_target_current}" "cflags" "${flag}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_target_item "${_xmake_sh_target_current}" "cflags" "${@}"
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
- for flag in $@; do
|
|
|
|
- _add_option_item "${_xmake_sh_option_current}" "cflags" "${flag}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_option_item "${_xmake_sh_option_current}" "cflags" "${@}"
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
|
|
# add cxflags in target
|
|
# add cxflags in target
|
|
add_cxflags() {
|
|
add_cxflags() {
|
|
- local flag=""
|
|
|
|
if ${_loading_targets} && test_z "${_xmake_sh_option_current}"; then
|
|
if ${_loading_targets} && test_z "${_xmake_sh_option_current}"; then
|
|
- for flag in $@; do
|
|
|
|
- _add_target_item "${_xmake_sh_target_current}" "cxflags" "${flag}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_target_item "${_xmake_sh_target_current}" "cxflags" "${@}"
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
- for flag in $@; do
|
|
|
|
- _add_option_item "${_xmake_sh_option_current}" "cxflags" "${flag}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_option_item "${_xmake_sh_option_current}" "cxflags" "${@}"
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
|
|
# add cxxflags in target
|
|
# add cxxflags in target
|
|
add_cxxflags() {
|
|
add_cxxflags() {
|
|
- local flag=""
|
|
|
|
if ${_loading_targets} && test_z "${_xmake_sh_option_current}"; then
|
|
if ${_loading_targets} && test_z "${_xmake_sh_option_current}"; then
|
|
- for flag in $@; do
|
|
|
|
- _add_target_item "${_xmake_sh_target_current}" "cxxflags" "${flag}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_target_item "${_xmake_sh_target_current}" "cxxflags" "${@}"
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
elif ${_loading_options} && test_nz "${_xmake_sh_option_current}"; then
|
|
- for flag in $@; do
|
|
|
|
- _add_option_item "${_xmake_sh_option_current}" "cxxflags" "${flag}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_option_item "${_xmake_sh_option_current}" "cxxflags" "${@}"
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2299,10 +2261,7 @@ add_asflags() {
|
|
if ! ${_loading_targets}; then
|
|
if ! ${_loading_targets}; then
|
|
return
|
|
return
|
|
fi
|
|
fi
|
|
- local flag=""
|
|
|
|
- for flag in $@; do
|
|
|
|
- _add_target_item "${_xmake_sh_target_current}" "asflags" "${flag}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_target_item "${_xmake_sh_target_current}" "asflags" "${@}"
|
|
}
|
|
}
|
|
|
|
|
|
# add mflags in target
|
|
# add mflags in target
|
|
@@ -2310,10 +2269,7 @@ add_mflags() {
|
|
if ! ${_loading_targets}; then
|
|
if ! ${_loading_targets}; then
|
|
return
|
|
return
|
|
fi
|
|
fi
|
|
- local flag=""
|
|
|
|
- for flag in $@; do
|
|
|
|
- _add_target_item "${_xmake_sh_target_current}" "mflags" "${flag}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_target_item "${_xmake_sh_target_current}" "mflags" "${@}"
|
|
}
|
|
}
|
|
|
|
|
|
# add mxflags in target
|
|
# add mxflags in target
|
|
@@ -2321,10 +2277,7 @@ add_mxflags() {
|
|
if ! ${_loading_targets}; then
|
|
if ! ${_loading_targets}; then
|
|
return
|
|
return
|
|
fi
|
|
fi
|
|
- local flag=""
|
|
|
|
- for flag in $@; do
|
|
|
|
- _add_target_item "${_xmake_sh_target_current}" "mxflags" "${flag}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_target_item "${_xmake_sh_target_current}" "mxflags" "${@}"
|
|
}
|
|
}
|
|
|
|
|
|
# add mxxflags in target
|
|
# add mxxflags in target
|
|
@@ -2332,10 +2285,7 @@ add_mxxflags() {
|
|
if ! ${_loading_targets}; then
|
|
if ! ${_loading_targets}; then
|
|
return
|
|
return
|
|
fi
|
|
fi
|
|
- local flag=""
|
|
|
|
- for flag in $@; do
|
|
|
|
- _add_target_item "${_xmake_sh_target_current}" "mxxflags" "${flag}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_target_item "${_xmake_sh_target_current}" "mxxflags" "${@}"
|
|
}
|
|
}
|
|
|
|
|
|
# add ldflags in target
|
|
# add ldflags in target
|
|
@@ -2343,10 +2293,7 @@ add_ldflags() {
|
|
if ! ${_loading_targets}; then
|
|
if ! ${_loading_targets}; then
|
|
return
|
|
return
|
|
fi
|
|
fi
|
|
- local flag=""
|
|
|
|
- for flag in $@; do
|
|
|
|
- _add_target_item "${_xmake_sh_target_current}" "ldflags" "${flag}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_target_item "${_xmake_sh_target_current}" "ldflags" "${@}"
|
|
}
|
|
}
|
|
|
|
|
|
# add shflags in target
|
|
# add shflags in target
|
|
@@ -2354,10 +2301,7 @@ add_shflags() {
|
|
if ! ${_loading_targets}; then
|
|
if ! ${_loading_targets}; then
|
|
return
|
|
return
|
|
fi
|
|
fi
|
|
- local flag=""
|
|
|
|
- for flag in $@; do
|
|
|
|
- _add_target_item "${_xmake_sh_target_current}" "shflags" "${flag}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_target_item "${_xmake_sh_target_current}" "shflags" "${@}"
|
|
}
|
|
}
|
|
|
|
|
|
# add arflags in target
|
|
# add arflags in target
|
|
@@ -2365,10 +2309,7 @@ add_arflags() {
|
|
if ! ${_loading_targets}; then
|
|
if ! ${_loading_targets}; then
|
|
return
|
|
return
|
|
fi
|
|
fi
|
|
- local flag=""
|
|
|
|
- for flag in $@; do
|
|
|
|
- _add_target_item "${_xmake_sh_target_current}" "arflags" "${flag}"
|
|
|
|
- done
|
|
|
|
|
|
+ _add_target_item "${_xmake_sh_target_current}" "arflags" "${@}"
|
|
}
|
|
}
|
|
|
|
|
|
# add options in target
|
|
# add options in target
|