Skip to content

Commit

Permalink
meson.eclass: style cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
floppym committed May 5, 2018
1 parent e6770aa commit 6129573
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions eclass/meson.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,16 @@ __MESON_AUTO_DEPEND=${MESON_AUTO_DEPEND} # See top of eclass


read -d '' __MESON_ARRAY_PARSER <<"EOF"
import shlex;
import shlex
import sys
# See http://mesonbuild.com/Syntax.html#strings
def quote(str):
escaped = str.replace("\\\\", "\\\\\\\\").replace("'", "\\\\'")
return "'{}'".format(escaped)
print("[{}]".format(
", ".join([quote(x) for x in shlex.split(None)])))
", ".join([quote(x) for x in shlex.split(" ".join(sys.argv[1:]))])))
EOF

# @FUNCTION: _meson_env_array
Expand All @@ -124,7 +125,7 @@ EOF
# '--unicode-16=𐐷', '--unicode-32=𐤅']
#
_meson_env_array() {
echo "$1" | python -c "$__MESON_ARRAY_PARSER"
python -c "${__MESON_ARRAY_PARSER}" "$@"
}

# @FUNCTION: _meson_create_cross_file
Expand Down Expand Up @@ -165,13 +166,13 @@ _meson_create_cross_file() {
strip = '${STRIP}'
[properties]
c_args = $(_meson_env_array "$CFLAGS")
c_link_args = $(_meson_env_array "$LDFLAGS")
cpp_args = $(_meson_env_array "$CXXFLAGS")
cpp_link_args = $(_meson_env_array "$LDFLAGS")
fortran_args = $(_meson_env_array "$FCFLAGS")
objc_args = $(_meson_env_array "$OBJCFLAGS")
objcpp_args = $(_meson_env_array "$OBJCXXFLAGS")
c_args = $(_meson_env_array "${CFLAGS}")
c_link_args = $(_meson_env_array "${LDFLAGS}")
cpp_args = $(_meson_env_array "${CXXFLAGS}")
cpp_link_args = $(_meson_env_array "${LDFLAGS}")
fortran_args = $(_meson_env_array "${FCFLAGS}")
objc_args = $(_meson_env_array "${OBJCFLAGS}")
objcpp_args = $(_meson_env_array "${OBJCXXFLAGS}")
[host_machine]
system = '${system}'
Expand Down

0 comments on commit 6129573

Please sign in to comment.