Don't compile fish_test_helper with thread sanitizer

Certain TSan versions will modify the blocked signal mask on startup, which
breaks fish's test that it correctly blocks certain signals on nohup.
This commit is contained in:
ridiculousfish 2020-11-23 11:45:37 -08:00
parent 1d2dd3975a
commit d129ee00a1

View file

@ -219,6 +219,15 @@ include(cmake/Install.cmake)
# Mac app.
include(cmake/MacApp.cmake)
# ThreadSanitizer likes to muck with signal handlers, which interferes
# with fish_test_helper printing the ignored signal mask.
# Ensure fish_test_helper does not use TSan.
# Note the environment var is CXXFLAGS, but the CMake var is CMAKE_CXX_FLAGS.
if (CMAKE_CXX_FLAGS MATCHES ".*-fsanitize=thread.*")
target_compile_options(fish_test_helper PRIVATE "-fno-sanitize=all")
target_link_libraries(fish_test_helper "-fno-sanitize=all")
endif()
# Lint targets
# This could be implemented as target properties, but the script has the useful feature of only
# checking the currently-staged commands