Add AddressSanitizer option to CMake

pull/1432/head
Turo Lamminen 2017-09-12 18:57:44 +03:00
parent c202d43d8f
commit 4652b66bb5
1 changed files with 9 additions and 0 deletions

View File

@ -82,6 +82,10 @@ OPTION ( ASSIMP_WERROR
"Treat warnings as errors."
OFF
)
OPTION ( ASSIMP_ASAN
"Enable AddressSanitizer."
OFF
)
OPTION ( SYSTEM_IRRXML
"Use system installed Irrlicht/IrrXML library."
OFF
@ -223,6 +227,11 @@ if (ASSIMP_WERROR)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
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 (PrecompiledHeader)