From 5467b0d0f83152d4c8c57ed1e97458cd2f709e70 Mon Sep 17 00:00:00 2001 From: Tomas Baca Date: Sat, 9 Dec 2023 09:14:58 +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 b60cac9..346f832 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,12 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") +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() + set(LIBRARIES MrsUavManagers_GainManager MrsUavManagers_ConstraintManager @@ -164,9 +170,6 @@ target_link_libraries(MrsUavManagers_TransformManager if(CATKIN_ENABLE_TESTING) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") - add_subdirectory(test) endif()