Support turning on asan & ubsan from cmake options
This commit is contained in:
parent
e0afe8b935
commit
c74daa5d9a
1 changed files with 10 additions and 0 deletions
|
|
@ -16,6 +16,16 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Cl
|
|||
list(APPEND PSEMEK_CXX_FLAGS -Wall -Werror -Wextra -pedantic -Wno-narrowing -Wno-sign-compare)
|
||||
endif()
|
||||
|
||||
option(PSEMEK_ASAN "Turn on Address Sanitizer" OFF)
|
||||
if(PSEMEK_ASAN)
|
||||
list(APPEND CMAKE_CXX_FLAGS -fsanitize=address)
|
||||
endif()
|
||||
|
||||
option(PSEMEK_UBSAN "Turn on UB Sanitizer" OFF)
|
||||
if(PSEMEK_UBSAN)
|
||||
list(APPEND CMAKE_CXX_FLAGS -fsanitize=undefined)
|
||||
endif()
|
||||
|
||||
set(Boost_USE_STATIC_LIBS ON)
|
||||
|
||||
add_subdirectory(package)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue