Add code coverage info support #57
@@ -30,6 +30,7 @@ option(ICU "ICU support for convert codepages" ${_ICU_DEFAULT})
|
|||||||
option(STD_IOSTREAM "Building with std iostream operators support" OFF)
|
option(STD_IOSTREAM "Building with std iostream operators support" OFF)
|
||||||
option(INTROSPECTION "Build with introspection" OFF)
|
option(INTROSPECTION "Build with introspection" OFF)
|
||||||
option(TESTS "Build tests and perform their before install step" OFF)
|
option(TESTS "Build tests and perform their before install step" OFF)
|
||||||
|
option(COVERAGE "Build project with coverage info" OFF)
|
||||||
set(PIP_UTILS 1)
|
set(PIP_UTILS 1)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
@@ -215,6 +216,18 @@ else()
|
|||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(PIP_COVERAGE "no")
|
||||||
|
if (COVERAGE)
|
||||||
|
find_program(GCOV_EXECUTABLE gcov)
|
||||||
|
if (GCOV_EXECUTABLE)
|
||||||
|
set(PIP_COVERAGE "yes")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
|
||||||
|
else()
|
||||||
|
message(STATUS "GCOV_EXECUTABLE: not found")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Check if std::iostream operators support
|
# Check if std::iostream operators support
|
||||||
set(PIP_STD_IOSTREAM "no")
|
set(PIP_STD_IOSTREAM "no")
|
||||||
@@ -595,6 +608,7 @@ message(" std::iostream: ${PIP_STD_IOSTREAM}")
|
|||||||
message(" ICU strings : ${PIP_ICU}")
|
message(" ICU strings : ${PIP_ICU}")
|
||||||
message(" Timer types : ${PIP_TIMERS}")
|
message(" Timer types : ${PIP_TIMERS}")
|
||||||
message(" Introspection: ${PIP_INTROSPECTION}")
|
message(" Introspection: ${PIP_INTROSPECTION}")
|
||||||
|
message(" Coverage : ${PIP_COVERAGE}")
|
||||||
if(INTROSPECTION)
|
if(INTROSPECTION)
|
||||||
message(STATUS " Warning: Introspection reduces the performance!")
|
message(STATUS " Warning: Introspection reduces the performance!")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user