File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change 1
1
add_main_dependencies ()
2
2
3
+ if (CONNECTION_MACHINE_CODE_COVERAGE )
4
+ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" )
5
+ message (STATUS "Code coverage enabled" )
6
+ add_compile_options (--coverage -O0 -g )
7
+ add_link_options (--coverage )
8
+ elseif (MSVC )
9
+ message (WARNING "Code coverage does nothing with MSVC. Use normal Tests build, and use opencpp_coverage.cmd" )
10
+ else ()
11
+ message (WARNING "Code coverage not working with: \" ${CMAKE_CXX_COMPILER_ID} \" " )
12
+ endif ()
13
+ else ()
14
+ message (WARNING "Code coverage cant not be used without also enabling tests." )
15
+ endif ()
16
+
17
+
3
18
# Google Testing
4
19
5
20
CPMAddPackage (
@@ -35,18 +50,3 @@ target_link_libraries(${PROJECT_NAME}_tests PRIVATE ${EXTERNAL_LINKS})
35
50
36
51
target_precompile_headers (${PROJECT_NAME} _tests PRIVATE "${SOURCE_DIR} /precompiled.h" )
37
52
38
- if (CONNECTION_MACHINE_CODE_COVERAGE )
39
- if (CONNECTION_MACHINE_BUILD_TESTS )
40
- if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" )
41
- message (STATUS "Code coverage enabled" )
42
- add_compile_options (--coverage -O0 -g )
43
- add_link_options (--coverage )
44
- elseif (MSVC )
45
- message (WARNING "Code coverage does nothing with MSVC. Use normal Tests build, and use opencpp_coverage.cmd" )
46
- else ()
47
- message (WARNING "Code coverage not working with: \" ${CMAKE_CXX_COMPILER_ID} \" " )
48
- endif ()
49
- else ()
50
- message (WARNING "Code coverage cant not be used without also enabling tests." )
51
- endif ()
52
- endif ()
You can’t perform that action at this time.
0 commit comments