From 11301872a1f9574cea1adb650c5d71968cf6e1a4 Mon Sep 17 00:00:00 2001 From: Tomas Baca Date: Sat, 9 Dec 2023 09:12:09 +0100 Subject: [PATCH] + conditioned coverage flags --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c287d48..e2319896 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,12 @@ add_definitions(-Wall) add_definitions(-Wextra) add_definitions(-Wpedantic) +if(COVERAGE) + message(WARNING "building with --coverage, the performance might be limited") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") +endif() + # remove warning info from PCL set(PCL_FIND_QUIETLY INTERNAL) @@ -371,9 +377,6 @@ target_link_libraries(cyclic_example if(CATKIN_ENABLE_TESTING) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") - add_subdirectory(test) endif()