Skip to content

Commit 509469d

Browse files
Tomas BacaTomas Baca
authored andcommitted
updated cmakelists flags
1 parent efa4cda commit 509469d

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

CMakeLists.txt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
2020
add_compile_options(-Wall -Wextra)
2121
endif()
2222

23-
if(MRS_ENABLE_TESTING)
24-
message(WARNING "Setting optimizaton levels for tests")
25-
add_definitions("-O1")
26-
add_definitions("-g")
27-
endif()
23+
if(ENABLE_COVERAGE)
24+
message(WARNING "building for coverage, the performance might be limited")
2825

29-
if(COVERAGE)
30-
message(WARNING "building with --coverage, the performance might be limited")
3126
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage -fprofile-arcs")
3227
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-arcs")
28+
29+
add_definitions("-O1")
30+
add_definitions("-g")
3331
endif()
3432

3533
set(DEPENDENCIES
@@ -131,8 +129,7 @@ pluginlib_export_plugin_description_file(mrs_uav_managers plugins.xml)
131129
## | testing |
132130
## --------------------------------------------------------------
133131

134-
# BUILD_TESTING is true by default when building with colcon
135-
if(BUILD_TESTING)
132+
if(ENABLE_TESTS)
136133

137134
add_subdirectory(test)
138135

0 commit comments

Comments
 (0)