1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 07:54:58 +00:00

Meta: Remove unused debug flags, add missing GENERATE_DEBUG

Commands that were helpful while investigating this:
```
grep -P '^set' Meta/CMake/all_the_debug_macros.cmake \
  | sed -Ee 's,set\((.+) ON\)$,\1,' > macros.lst
for i in $(cat macros.lst); do
  echo -n "$i "; git grep -Pn '\b'"$i"'\b' | wc -l
done | tee matches.lst
sort -k2 -n matches.lst
```
This commit is contained in:
Ben Wiederhake 2023-05-14 18:17:15 +02:00 committed by Andrew Kaster
parent c56481e73f
commit 173f872cda
4 changed files with 15 additions and 106 deletions

View file

@ -7,16 +7,11 @@ cd "${script_path}/.."
MISSING_FLAGS=n
# Check whether all_the_debug_macros.cmake sets all the flags used in C++ code.
while IFS= read -r FLAG; do
# Ignore false positives that are not debug flags.
if [ "$FLAG" = "ELF_DEBUG" ] || [ "$FLAG" = "IA32_DEBUG_INTERFACE" ]; then
continue
fi
# We simply search whether the CMakeLists.txt *ever* sets the flag.
# There are (basically) no false positives, but there might be false negatives,
# for example we intentionally don't check for commented-out lines here.
if ! grep -qF "set(${FLAG}" Meta/CMake/all_the_debug_macros.cmake ; then
# We intentionally don't check for commented-out lines,
# in order to keep track of false positives.
if ! grep -qF "set(${FLAG} ON)" Meta/CMake/all_the_debug_macros.cmake ; then
echo "'all_the_debug_macros.cmake' is missing ${FLAG}"
MISSING_FLAGS=y
fi
@ -49,5 +44,7 @@ if [ "n" != "${MISSING_FLAGS}" ] ; then
echo "If you just added a new SOMETHING_DEBUG flag, that's great!"
echo "We want to enable all of these in automated builds, so that the code doesn't rot."
echo "Please add it to Meta/CMake/all_the_debug_macros.cmake"
echo "Or perhaps it's not a debug flag?"
echo "Please also add it to Meta/CMake/all_the_debug_macros.cmake"
exit 1
fi