Browse Source

Fix file size stat in build tool on Mac

master
cancel 6 years ago
parent
commit
d44de14784
  1. 6
      tool

6
tool

@ -86,6 +86,10 @@ TIMEFORMAT='%3R'
last_time= last_time=
file_size() {
wc -c < "$1" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
}
timed_stats() { timed_stats() {
if [[ $stats_enabled = 1 ]]; then if [[ $stats_enabled = 1 ]]; then
{ last_time=$( { time "$@" 1>&3- 2>&4-; } 2>&1 ); } 3>&1 4>&2 { last_time=$( { time "$@" 1>&3- 2>&4-; } 2>&1 ); } 3>&1 4>&2
@ -196,7 +200,7 @@ build_target() {
verbose_echo timed_stats "$compiler_exe" "${compiler_flags[@]}" -o "$out_path" "${source_files[@]}" ${libraries[@]+"${libraries[@]}"} verbose_echo timed_stats "$compiler_exe" "${compiler_flags[@]}" -o "$out_path" "${source_files[@]}" ${libraries[@]+"${libraries[@]}"}
if [[ $stats_enabled = 1 ]]; then if [[ $stats_enabled = 1 ]]; then
echo "time: $last_time" echo "time: $last_time"
stat -c "size: %s" -- "$out_path" echo "size: $(file_size "$out_path")"
fi fi
} }

Loading…
Cancel
Save