Allow compiling STK with thread sanitizer

This commit is contained in:
Benau 2020-02-23 01:14:41 +08:00
parent 2872706317
commit 68ecc980c7

View File

@ -79,6 +79,7 @@ endif()
if(UNIX AND NOT APPLE)
option(USE_ASAN "Build with Leak/Address sanitizer" OFF)
option(USE_TSAN "Build with Thread sanitizer" OFF)
option(USE_LIBBFD "Use libbfd for crash reporting and leak check" OFF)
endif()
@ -650,6 +651,10 @@ if(UNIX AND NOT APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
target_link_libraries(supertuxkart "-fsanitize=address")
endif()
if(USE_TSAN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -fno-omit-frame-pointer")
target_link_libraries(supertuxkart "-fsanitize=thread")
endif()
endif()
if(BUILD_RECORDER)