mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-21 13:45:38 +00:00
Added an UndefinedBehaviorSanitizer option to the CMake configuration file.
This commit is contained in:
parent
9937476e18
commit
c5c7835dbb
|
@ -38,6 +38,7 @@ option(VLC_PLAYER "Set to ON to build the VLC-based video player" ${VLC_PLAYER})
|
|||
option(CLANG_TIDY "Set to ON to build using the clang-tidy static analyzer" ${CLANG_TIDY})
|
||||
option(ASAN "Set to ON to build with AddressSanitizer" ${ASAN})
|
||||
option(TSAN "Set to ON to build with ThreadSanitizer" ${TSAN})
|
||||
option(UBSAN "Set to ON to build with UndefinedBehaviorSanitizer" ${UBSAN})
|
||||
|
||||
if(CLANG_TIDY)
|
||||
find_program(CLANG_TIDY_BINARY NAMES clang-tidy)
|
||||
|
@ -213,6 +214,15 @@ if(TSAN)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(UBSAN)
|
||||
message("-- Building with UndefinedBehaviorSanitizer")
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
message(FATAL_ERROR "-- UndefinedBehaviorSanitizer not available for MSVC")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# The following removes half of the ranlib warnings on macOS regarding no symbols for files
|
||||
# that are #ifdef'ed away. There must be a way to remove the other half as well?
|
||||
if(APPLE)
|
||||
|
|
Loading…
Reference in a new issue