From: Turo Lamminen Date: Tue, 12 Sep 2017 15:57:44 +0000 (+0300) Subject: Add AddressSanitizer option to CMake X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=190f034e38bc130461df3f26b0f8fe1b650658aa;p=platform%2Fupstream%2Fassimp.git Add AddressSanitizer option to CMake --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 690351e..260b786 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,6 +78,10 @@ OPTION ( ASSIMP_COVERALLS "Enable this to measure test coverage." OFF ) +OPTION ( ASSIMP_ASAN + "Enable AddressSanitizer." + OFF +) OPTION ( SYSTEM_IRRXML "Use system installed Irrlicht/IrrXML library." OFF @@ -212,6 +216,11 @@ if (ASSIMP_COVERALLS) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") 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)