build: fail with CLANG_TSAN + USE_GCOV #10958

This is better than skipping it silently.
This commit is contained in:
Daniel Hahler
2019-09-06 17:41:04 +02:00
committed by Justin M. Keyes
parent 8b06231612
commit fecbafb29e

View File

@@ -1,15 +1,16 @@
option(USE_GCOV "Enable gcov support" OFF)
if(NOT CLANG_TSAN)
# GCOV and TSAN results in false data race reports
if(USE_GCOV)
if(CLANG_TSAN)
# GCOV and TSAN results in false data race reports
message(FATAL_ERROR "USE_GCOV cannot be used with CLANG_TSAN")
endif()
message(STATUS "Enabling gcov support")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage")
add_definitions(-DUSE_GCOV)
endif()
endif()
if(WIN32)
# tell MinGW compiler to enable wmain