tests: make code coverage for unit tests optional
Add a new cmake option VPP_BUILD_TESTS_WITH_COVERAGE to enable
building unittests with clang code coverage.
Type: improvement
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I9cbe9e3031afdcd03bc8f9203d662b91677724ab
Signed-off-by: Ole Troan <ot@cisco.com>
diff --git a/src/vat2/CMakeLists.txt b/src/vat2/CMakeLists.txt
index c44d245..31d4293 100644
--- a/src/vat2/CMakeLists.txt
+++ b/src/vat2/CMakeLists.txt
@@ -52,8 +52,7 @@
rt m dl crypto
)
#target_link_options(test_vat2 PUBLIC "LINKER:-fsanitize=address")
-
-if("${CMAKE_VERSION}" VERSION_GREATER_EQUAL "3.13" AND "${CMAKE_C_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
+if(VPP_BUILD_TESTS_WITH_COVERAGE)
set(TARGET_NAME test_vat2)
message("Building with llvm Code Coverage Tools ${TARGET_NAME}")