mirror of
https://github.com/qicosmos/rest_rpc.git
synced 2026-08-29 16:40:48 +08:00
add codecov test cmake option
This commit is contained in:
@@ -22,3 +22,13 @@ if (ENABLE_JAVA)
|
||||
find_package(JNI REQUIRED)
|
||||
message(STATUS "Use Java")
|
||||
endif()
|
||||
|
||||
# coverage test
|
||||
option(COVERAGE_TEST "Build with unit test coverage" OFF)
|
||||
if(COVERAGE_TEST)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage --coverage")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-instr-generate -fcoverage-mapping")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user