Add AddressSanitizer option to CMake

pull/1427/head
Turo Lamminen 2017-09-12 18:57:44 +03:00
parent f7d39cfa71
commit 190f034e38
1 changed files with 9 additions and 0 deletions

View File

@ -78,6 +78,10 @@ OPTION ( ASSIMP_COVERALLS
"Enable this to measure test coverage." "Enable this to measure test coverage."
OFF OFF
) )
OPTION ( ASSIMP_ASAN
"Enable AddressSanitizer."
OFF
)
OPTION ( SYSTEM_IRRXML OPTION ( SYSTEM_IRRXML
"Use system installed Irrlicht/IrrXML library." "Use system installed Irrlicht/IrrXML library."
OFF OFF
@ -212,6 +216,11 @@ if (ASSIMP_COVERALLS)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
endif() endif()
if (ASSIMP_ASAN)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
endif()
INCLUDE (FindPkgMacros) INCLUDE (FindPkgMacros)
INCLUDE (PrecompiledHeader) INCLUDE (PrecompiledHeader)