summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-05-29 10:15:29 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-05-29 10:15:29 -0700
commitb4599a48694b78a5db144f17c2ab281a6d9f17d1 (patch)
tree44196cf7204aade8acfce11f76551be0831e3923 /src
parent8f429810c03f1d869936776b174332d55ff88bde (diff)
Added Ubsan build target, to check for undefined behavior.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
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