Skip to content

Commit

Permalink
Allow compiling STK with thread sanitizer
Browse files Browse the repository at this point in the history
  • Loading branch information
Benau committed Feb 22, 2020
1 parent 2872706 commit 68ecc98
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 68ecc98

Please sign in to comment.