summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2022-03-06 20:44:39 +0100
committerSander Vrijders <sander@ouroboros.rocks>2022-03-08 17:40:18 +0100
commit7e4e488f00f60fe3a0241c42d0034e1a7617e1bd (patch)
tree112306164a9a46f347bf94fbf545f675951db3ac /CMakeLists.txt
parent40ca5385e97f393d0c231446f117ad43465735a7 (diff)
downloadouroboros-7e4e488f00f60fe3a0241c42d0034e1a7617e1bd.tar.gz
ouroboros-7e4e488f00f60fe3a0241c42d0034e1a7617e1bd.zip
build: Add debug option for fsanitize=undefined
The sanitizer for undefined behaviour can now be enabled using DebugUSan build option for convenience. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 27fe03ef..eeea8f7d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,7 +20,7 @@ set(PACKAGE_VERSION
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
- "Build type (Release, Debug, DebugASan, DebugTSan, DebugLSan, DebugAnalyzer)" FORCE)
+ "Build type (Release, Debug, DebugASan, DebugTSan, DebugLSan, DebugUSan, DebugAnalyzer)" FORCE)
endif()
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
@@ -104,6 +104,8 @@ elseif (CMAKE_BUILD_TYPE STREQUAL "DebugTSan")
test_and_set_c_compiler_flag_global(-fsanitize=thread)
elseif (CMAKE_BUILD_TYPE STREQUAL "DebugLSan")
test_and_set_c_compiler_flag_global(-fsanitize=leak)
+elseif (CMAKE_BUILD_TYPE STREQUAL "DebugUSan")
+ test_and_set_c_compiler_flag_global(-fsanitize=undefined)
elseif (CMAKE_BUILD_TYPE STREQUAL "DebugAnalyzer")
test_and_set_c_compiler_flag_global(-fanalyzer)
endif ()