diff options
author | Christian Rauch <Rauch.Christian@gmx.de> | 2021-01-31 19:09:25 -0800 |
---|---|---|
committer | Christian Rauch <Rauch.Christian@gmx.de> | 2021-01-31 19:09:25 -0800 |
commit | 4a5c7fcb3191c804913d7e8554e67f7506a80498 (patch) | |
tree | 0019d7a1cbda6f2eaf6fbbffc791277336f59ed3 | |
parent | 258c6abca6f4318b7cdbcb336a1aa5d9542dd441 (diff) | |
download | sdl-4a5c7fcb3191c804913d7e8554e67f7506a80498.tar.gz |
cmake: enable AddressSanitizer in Debug builds
-rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 40ddc0d03..cf3aa20fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2323,6 +2323,23 @@ if(SDL_STATIC) endif() endif() +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} \ + -fsanitize=address \ + -fsanitize=bool \ + -fsanitize=bounds \ + -fsanitize=enum \ + -fsanitize=float-cast-overflow \ + -fsanitize=float-divide-by-zero \ + -fsanitize=nonnull-attribute \ + -fsanitize=returns-nonnull-attribute \ + -fsanitize=signed-integer-overflow \ + -fsanitize=undefined \ + -fsanitize=vla-bound \ + -fno-sanitize=alignment \ + -fsanitize=leak \ + -fsanitize=object-size \ +") + ##### Tests ##### if(SDL_TEST) |