diff --git a/CMakeLists.txt b/CMakeLists.txt index 4132f569b4de..b5d9fa86c6b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,7 +103,6 @@ if(USE_NULL_ENCRYPTOR) endif() option(SAN "Enable Address and Undefined Behavior Sanitizers" OFF) -option(TSAN "Enable Thread Sanitizers" OFF) option(BUILD_END_TO_END_TESTS "Build end to end tests" ON) option(COVERAGE "Enable coverage mapping" OFF) option(SHUFFLE_SUITE "Shuffle end to end test suite" OFF) diff --git a/cmake/preproject.cmake b/cmake/preproject.cmake index b76d5cbda635..95c2dbefe69a 100644 --- a/cmake/preproject.cmake +++ b/cmake/preproject.cmake @@ -58,6 +58,8 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) ) endif() +option(TSAN "Enable Thread Sanitizers" OFF) + option(COLORED_OUTPUT "Always produce ANSI-colored output." ON) if(${COLORED_OUTPUT}) @@ -86,7 +88,7 @@ if("${COMPILE_TARGET}" STREQUAL "snp") endif() if("${COMPILE_TARGET}" STREQUAL "snp" OR "${COMPILE_TARGET}" STREQUAL "virtual") - if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" AND NOT TSAN) add_compile_options(-flto) add_link_options(-flto) endif()