From: TimePath Date: Tue, 15 Mar 2016 09:23:25 +0000 (+1100) Subject: qcc.sh: fix preprocessor error reporting X-Git-Tag: xonotic-v0.8.2~1076 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0522fbc888432a74d62bf268b0d3ecc0dc25f5d2;p=xonotic%2Fxonotic-data.pk3dir.git qcc.sh: fix preprocessor error reporting --- diff --git a/qcsrc/tools/qcc.sh b/qcsrc/tools/qcc.sh index 92f8b98fb..40223c113 100755 --- a/qcsrc/tools/qcc.sh +++ b/qcsrc/tools/qcc.sh @@ -1,5 +1,6 @@ #!/bin/bash -set -eu +set -euo pipefail +IFS=$' \n\t' WORKDIR=${WORKDIR} CPP=${CPP} @@ -12,6 +13,7 @@ function qpp() { IN=$1 OUT=$2 >&2 echo + ${CPP} ${@:3} ${IN} + set +e # additional information ${CPP} ${@:3} \ -dM 1>${WORKDIR}/${MODE}_macros.txt \ @@ -19,6 +21,9 @@ function qpp() { ${IN} # main step ${CPP} ${@:3} -MMD -MP -MT ${OUT} -Wall -Wundef -Werror ${IN} -o ${WORKDIR}/${MODE}.txt + err=$? + set -e + if [ ${err} -ne 0 ]; then return ${err}; fi sed 's/^#\(line\)\? \([[:digit:]]\+\) "\(.*\)".*/\n#pragma file(\3)\n#pragma line(\2)/g' ${WORKDIR}/${MODE}.txt }