1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-06-28 18:17:11 -07:00

omit warning flags from echo

This commit is contained in:
Connor Olding 2017-05-03 08:01:48 +00:00
parent fe73819bc3
commit 37583090f4

View File

@ -113,18 +113,22 @@ compile() {
# by generating a file that #includes each given file. # by generating a file that #includes each given file.
# move -l flags to the end because gcc won't respect them otherwise # move -l flags to the end because gcc won't respect them otherwise
# split warning flags so they don't spam the console
local final_flags=() local final_flags=()
local libraries=() local libraries=()
local warnings=()
for flag in $our_flags $flags; do for flag in $our_flags $flags; do
if [[ $flag == -l* ]]; then if [[ $flag == -l* ]]; then
libraries+=($flag) libraries+=($flag)
elif [[ $flag == -W* ]]; then
warnings+=($flag)
else else
final_flags+=($flag) final_flags+=($flag)
fi fi
done done
echo $compiler $std ${final_flags[@]} $file ${libraries[@]} -o $out echo $compiler $std ${final_flags[@]} $file ${libraries[@]} -o $out >&2
$compiler $std ${final_flags[@]} $file ${libraries[@]} -o $out >&2 $compiler $std ${final_flags[@]} $file ${libraries[@]} ${warnings[@]} -o $out >&2
} }
compile "$@" compile "$@"