Skip to content

Commit 0575539

Browse files
committed
Update cc_wrapper.sh.tpl
1 parent 8cf1a6b commit 0575539

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

toolchain/cc_wrapper.sh.tpl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,18 @@ if [[ ! -f ${toolchain_path_prefix}bin/clang ]]; then
8282
exit 5
8383
fi
8484

85+
OUTPUT=
86+
87+
function parse_option() {
88+
local -r opt="$1"
89+
if [[ "${OUTPUT}" = "1" ]]; then
90+
OUTPUT=$opt
91+
elif [[ "$opt" = "-o" ]]; then
92+
# output is coming
93+
OUTPUT=1
94+
fi
95+
}
96+
8597
function sanitize_option() {
8698
local -r opt=$1
8799
if [[ ${opt} == */cc_wrapper.sh ]]; then
@@ -106,6 +118,7 @@ for ((i = 0; i <= $#; i++)); do
106118
set -e
107119
sanitize_option "${opt}"
108120
)"
121+
parse_option "${opt}"
109122
echo "${opt}" >>"${tmpfile}"
110123
done <"${!i:1}"
111124
cmd+=("@${tmpfile}")
@@ -114,6 +127,7 @@ for ((i = 0; i <= $#; i++)); do
114127
set -e
115128
sanitize_option "${!i}"
116129
)"
130+
parse_option "${opt}"
117131
cmd+=("${opt}")
118132
fi
119133
done

0 commit comments

Comments
 (0)