2023-07-25 11:53:09 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
. .github/scripts/flags-clang.sh
|
|
|
|
|
|
|
|
add_ld_flag -Wl,-z,defs
|
|
|
|
|
|
|
|
# Make compilation error on a warning
|
2024-01-12 21:30:48 +01:00
|
|
|
add_flag -Werror -Wno-unsafe-buffer-usage
|
2023-07-25 11:53:09 +02:00
|
|
|
|
|
|
|
# Coverage flags.
|
2024-01-12 21:30:48 +01:00
|
|
|
add_flag -fprofile-instr-generate -fcoverage-mapping
|
2023-07-25 11:53:09 +02:00
|
|
|
|
|
|
|
# Optimisation, but keep stack traces useful.
|
|
|
|
add_c_flag -fno-inline -fno-omit-frame-pointer
|
|
|
|
|
|
|
|
# Show useful stack traces on crash.
|
2023-12-27 12:37:22 +01:00
|
|
|
add_flag -fsanitize=undefined -fno-sanitize-recover=all -D_DEBUG
|
2023-07-25 11:53:09 +02:00
|
|
|
|
|
|
|
# In test code (_test.cc and libgtest), throw away all debug information.
|
|
|
|
# We only care about stack frames inside toxcore (which is C). Without this,
|
|
|
|
# mallocfail will spend a lot of time finding all the ways in which gtest can
|
|
|
|
# fail to allocate memory, which is not interesting to us.
|
|
|
|
add_cxx_flag -g0
|
|
|
|
|
|
|
|
# Continue executing code in error paths so we can see it cleanly exit (and the
|
|
|
|
# test code itself may abort).
|
|
|
|
add_flag -DABORT_ON_LOG_ERROR=false
|