Skip to content

Commit

Permalink
Turn off LTO when using ThreadSanitizer
Browse files Browse the repository at this point in the history
  • Loading branch information
achamayou committed Jan 5, 2024
1 parent 43feda0 commit a504e44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion cmake/preproject.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit a504e44

Please sign in to comment.