Add UBsan build type

This commit is contained in:
Rodrigo Arias 2021-11-19 17:41:10 +01:00
parent e8860a5f99
commit 4dc3b6116e

View File

@ -36,7 +36,7 @@ endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel or Asan." FORCE)
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel Asan UBsan." FORCE)
endif(NOT CMAKE_BUILD_TYPE)
include(CheckIPOSupported)
@ -65,6 +65,9 @@ set(CMAKE_C_FLAGS_ASAN "${CMAKE_C_FLAGS_DEBUG} \
-fno-omit-frame-pointer"
CACHE STRING "Flags used by the C compiler during AddressSanitizer builds." FORCE)
set(CMAKE_C_FLAGS_UBSAN "${CMAKE_C_FLAGS_DEBUG} -fsanitize=undefined"
CACHE STRING "Flags used by the C compiler during UndefinedBehaviorSanitizer builds." FORCE)
add_library(ovni SHARED
ovni.c
parson.c