2023-11-10 05:13:55 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-03-10 22:36:03 +00:00
|
|
|
export LC_ALL=C # The "total" should be printed without localization
|
|
|
|
|
2023-11-10 05:13:55 +00:00
|
|
|
# Check that there are no new translation units compiled to an object file larger than a certain size.
|
|
|
|
|
2023-11-22 15:33:07 +00:00
|
|
|
TU_EXCLUDES=(
|
|
|
|
AggregateFunctionUniq
|
|
|
|
Aggregator
|
|
|
|
)
|
|
|
|
|
2024-03-10 22:42:44 +00:00
|
|
|
if find $1 -name '*.o' | xargs wc -c | grep --regexp='\.o$' | sort -rn | awk '{ if ($1 > 50000000) print }' \
|
2023-11-22 15:33:07 +00:00
|
|
|
| grep -v -f <(printf "%s\n" "${TU_EXCLUDES[@]}")
|
2023-11-10 05:13:55 +00:00
|
|
|
then
|
|
|
|
echo "^ It's not allowed to have so large translation units."
|
|
|
|
exit 1
|
|
|
|
fi
|