mirror of
https://github.com/glfw/glfw.git
synced 2025-06-15 20:22:15 +00:00
cmake: enable AddressSanitizer in Debug builds
This commit is contained in:
parent
ce0e2096b5
commit
5df88303d2
@ -66,6 +66,25 @@ if (GLFW_BUILD_DOCS)
|
||||
find_package(Doxygen)
|
||||
endif()
|
||||
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
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 \
|
||||
")
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Set compiler specific flags
|
||||
#--------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user