File tree 3 files changed +8
-0
lines changed
3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -31,3 +31,9 @@ if(ANALYZE_UNDEFINED)
31
31
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=nullability" )
32
32
endif ()
33
33
endif ()
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()
20
20
option (ANALYZE_ADDRESS "Build with AddressSanitzer to detect memory error" OFF )
21
21
option (ANALYZE_THREAD "Build with ThreadSanitizer to detect data races" OFF )
22
22
option (ANALYZE_UNDEFINED "Build with UndefinedBehaviorSanitizer to detect undefined behavior" OFF )
23
+ option (ANALYZE_TYPE "Build with TypeSanitizer to detect aliasing issues" OFF )
23
24
24
25
option (WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF )
25
26
if (WARNINGS_ARE_ERRORS)
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ message(STATUS "ANALYZE_MEMORY = ${ANALYZE_MEMORY}")
30
30
message (STATUS "ANALYZE_ADDRESS = ${ANALYZE_ADDRESS} " )
31
31
message (STATUS "ANALYZE_THREAD = ${ANALYZE_THREAD} " )
32
32
message (STATUS "ANALYZE_UNDEFINED = ${ANALYZE_UNDEFINED} " )
33
+ message (STATUS "ANALYZE_TYPE = ${ANALYZE_TYPE} " )
33
34
message (STATUS )
34
35
message (STATUS "WARNINGS_ARE_ERRORS = ${WARNINGS_ARE_ERRORS} " )
35
36
message (STATUS "EXTERNALS_AS_SYSTEM = ${EXTERNALS_AS_SYSTEM} " )
You can’t perform that action at this time.
0 commit comments