if environment variable HIFI_MEMORY_DEBUGGING is defined when cmake is run, enable -fsanitize=address on linux

This commit is contained in:
Seth Alves 2015-08-19 18:03:16 -07:00
parent c9bd1cc829
commit 2056f588e3
3 changed files with 25 additions and 1 deletions

View file

@ -18,4 +18,12 @@ if (UNIX)
endif (UNIX)
include_application_version()
copy_dlls_beside_windows_executable()
copy_dlls_beside_windows_executable()
if (DEFINED ENV{HIFI_MEMORY_DEBUGGING})
if (UNIX)
MESSAGE("-- assignment-client memory debugging is enabled.")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
endif (UNIX)
endif ()

View file

@ -33,3 +33,11 @@ target_link_libraries(${TARGET_NAME} ${OPENSSL_LIBRARIES})
include_application_version()
copy_dlls_beside_windows_executable()
if (DEFINED ENV{HIFI_MEMORY_DEBUGGING})
if (UNIX)
MESSAGE("-- domain-server memory debugging is enabled.")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
endif (UNIX)
endif ()

View file

@ -206,3 +206,11 @@ else (APPLE)
endif (APPLE)
copy_dlls_beside_windows_executable()
if (DEFINED ENV{HIFI_MEMORY_DEBUGGING})
if (UNIX)
MESSAGE("-- interface memory debugging is enabled.")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
endif (UNIX)
endif ()