enable address sanitizer for g++
This commit is contained in:
parent
a491ab0461
commit
28243c267d
@ -3,6 +3,12 @@ project(stc_rpncalc C CXX)
|
|||||||
# 3rd party tools
|
# 3rd party tools
|
||||||
find_package(Qt5 COMPONENTS Widgets Qml Quick REQUIRED)
|
find_package(Qt5 COMPONENTS Widgets Qml Quick REQUIRED)
|
||||||
|
|
||||||
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
|
message(STATUS "using address sanitizer")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls")
|
||||||
|
link_libraries(asan)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (for tests debug make sense)")
|
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (for tests debug make sense)")
|
||||||
|
|
||||||
# Compiler warnings
|
# Compiler warnings
|
||||||
|
Loading…
Reference in New Issue
Block a user