File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change 22# Do not edit lines below
33
44# GCOV settings
5- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage" )
6- set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage" )
5+ if (NOT MSVC )
6+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage" )
7+ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage" )
8+ endif ()
79
810# List up all source files including main.cpp
911set (MAIN_FILE_PATTERN ".*/main.cpp$" )
@@ -19,13 +21,15 @@ set(TEST_EXECUTABLE_NAME test_${PROJECT_NAME})
1921# Add the executable for the testcase which is using googletest
2022add_executable (${TEST_EXECUTABLE_NAME} ${TEST_SRC} ${LIB_SRC} )
2123
22- # Delete the gcov data file before linking. Otherwise, we will get many errors.
23- add_custom_command (
24- TARGET ${TEST_EXECUTABLE_NAME} PRE_LINK
25- COMMAND find . -name "*.gcda" -delete
26- COMMENT "Deleting *.gcda files under ${CMAKE_BINARY_DIR} "
27- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
28- VERBATIM )
24+ if (NOT MSVC )
25+ # Delete the gcov data file before linking. Otherwise, we will get many errors.
26+ add_custom_command (
27+ TARGET ${TEST_EXECUTABLE_NAME} PRE_LINK
28+ COMMAND find . -name "*.gcda" -delete
29+ COMMENT "Deleting *.gcda files under ${CMAKE_BINARY_DIR} "
30+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
31+ VERBATIM )
32+ endif ()
2933
3034 # Add the library under test.
3135 target_link_libraries (${TEST_EXECUTABLE_NAME}
You can’t perform that action at this time.
0 commit comments