Add address sanitizer support for debugging double free

This commit is contained in:
Doug Johnson
2024-01-03 20:39:15 -07:00
parent 45bcbc75fd
commit f4485b5957

View File

@@ -138,6 +138,7 @@ option(GDBSTUB "Enable GDB stub server for debugging"
option(DEV_BRANCH "Development branch" OFF)
option(DISCORD "Discord Rich Presence support" ON)
option(DEBUGREGS486 "Enable debug register opeartion on 486+ CPUs" OFF)
option(LIBASAN "Enable compilation with the addresss sanitizer" OFF)
if(WIN32)
set(QT ON)
@@ -212,4 +213,10 @@ if(NOT EMU_COPYRIGHT_YEAR)
set(EMU_COPYRIGHT_YEAR 2024)
endif()
# Libasan
if(LIBASAN)
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
endif()
add_subdirectory(src)