mirror of
https://github.com/notwa/rc
synced 2024-07-01 03:07:13 -07:00
omit warning flags from echo
This commit is contained in:
parent
fe73819bc3
commit
37583090f4
|
@ -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 "$@"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user