mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:57:44 +00:00
CMake: Use built-in add_compile_definitions for *_DEBUG macros
Problem: - Modifying CXXFLAGS directly is an old CMake style. - The giant and ever-growing list of `*_DEBUG` macros clutters the top-level CMakeLists.txt. Solution: - Use the more current `add_compile_definitions` function. - Sort all the debug options so that they are easy to view. - Move the `*_DEBUG` macros to their own file which can be included directly.
This commit is contained in:
parent
32210802ac
commit
cef6b7b2e4
3 changed files with 171 additions and 28 deletions
|
@ -11,7 +11,7 @@ while IFS= read -r FLAG; do
|
|||
# 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 -qP "set\(CMAKE_CXX_FLAGS \".* -D${FLAG}" CMakeLists.txt ; then
|
||||
if ! grep -qP "add_compile_definitions\(\"${FLAG}" Meta/all_the_debug_macros.cmake ; then
|
||||
echo "ALL_THE_DEBUG_MACROS probably doesn't include ${FLAG}"
|
||||
MISSING_FLAGS=y
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue