From b4599a48694b78a5db144f17c2ab281a6d9f17d1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 29 May 2015 10:15:29 -0700 Subject: Added Ubsan build target, to check for undefined behavior. --- src/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/CMakeLists.txt') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ba3e18e..f27186e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -164,3 +164,7 @@ endif() if($ENV{TIMER}) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTIMER=1") endif($ENV{TIMER}) + +if(CMAKE_BUILD_TYPE STREQUAL "Ubsan") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined") +endif() \ No newline at end of file -- cgit v1.2.3