File tree Expand file tree Collapse file tree 3 files changed +8
-0
lines changed
Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -31,3 +31,9 @@ if(ANALYZE_UNDEFINED)
3131 set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=nullability" )
3232 endif ()
3333endif ()
34+
35+ if (ANALYZE_TYPE)
36+ add_compile_options (-fsanitize=type )
37+
38+ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=type" )
39+ endif ()
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ endif()
2020option (ANALYZE_ADDRESS "Build with AddressSanitzer to detect memory error" OFF )
2121option (ANALYZE_THREAD "Build with ThreadSanitizer to detect data races" OFF )
2222option (ANALYZE_UNDEFINED "Build with UndefinedBehaviorSanitizer to detect undefined behavior" OFF )
23+ option (ANALYZE_TYPE "Build with TypeSanitizer to detect aliasing issues" OFF )
2324
2425option (WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF )
2526if (WARNINGS_ARE_ERRORS)
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ message(STATUS "ANALYZE_MEMORY = ${ANALYZE_MEMORY}")
3030message (STATUS "ANALYZE_ADDRESS = ${ANALYZE_ADDRESS} " )
3131message (STATUS "ANALYZE_THREAD = ${ANALYZE_THREAD} " )
3232message (STATUS "ANALYZE_UNDEFINED = ${ANALYZE_UNDEFINED} " )
33+ message (STATUS "ANALYZE_TYPE = ${ANALYZE_TYPE} " )
3334message (STATUS )
3435message (STATUS "WARNINGS_ARE_ERRORS = ${WARNINGS_ARE_ERRORS} " )
3536message (STATUS "EXTERNALS_AS_SYSTEM = ${EXTERNALS_AS_SYSTEM} " )
You can’t perform that action at this time.
0 commit comments