From 7c03204c0cb6c3eb112ae32acc2be028c052a544 Mon Sep 17 00:00:00 2001 From: JackyWoo Date: Tue, 21 May 2024 13:55:54 +0800 Subject: [PATCH] Cannot enable coverage with sanitizers --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index dab9913e17..cef0b91ec2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,6 +168,9 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsized-deallocation") option(WITH_COVERAGE "Profile the resulting binary/binaries" OFF) if (WITH_COVERAGE) + if (SANITIZE) + message (FATAL_ERROR "Cannot enable coverage with sanitizers") + endif () set(COMPILER_FLAGS "${COMPILER_FLAGS} -fprofile-instr-generate -fcoverage-mapping") # If we want to disable coverage for specific translation units set(WITHOUT_COVERAGE "-fno-profile-instr-generate -fno-coverage-mapping")