diff options
author | Andrej Rode <mail@andrejro.de> | 2018-11-06 00:49:55 +0100 |
---|---|---|
committer | Andrej Rode <mail@andrejro.de> | 2018-11-09 15:20:04 +0100 |
commit | 5823f31bc997929e3e2273549856c67ddec6c00a (patch) | |
tree | 9a85e70be864d699ad8386f244e1272f33abc12e /cmake | |
parent | 1bdfaffeaa44075da86d8e6e78da89f8c3a73483 (diff) |
cmake: Fix coverage buildtype to use -lgcov for linking
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/CodeCoverage.cmake | 22 | ||||
-rw-r--r-- | cmake/Modules/GrBuildTypes.cmake | 9 |
2 files changed, 4 insertions, 27 deletions
diff --git a/cmake/Modules/CodeCoverage.cmake b/cmake/Modules/CodeCoverage.cmake index 4e96e3b3f9..285a185ec1 100644 --- a/cmake/Modules/CodeCoverage.cmake +++ b/cmake/Modules/CodeCoverage.cmake @@ -85,28 +85,6 @@ ELSEIF(NOT CMAKE_COMPILER_IS_GNUCXX) MESSAGE(FATAL_ERROR "Compiler is not GNU gcc! Aborting...") ENDIF() # CHECK VALID COMPILER -SET(CMAKE_CXX_FLAGS_COVERAGE - "-g -O0 --coverage -fprofile-arcs -ftest-coverage" - CACHE STRING "Flags used by the C++ compiler during coverage builds." - FORCE ) -SET(CMAKE_C_FLAGS_COVERAGE - "-g -O0 --coverage -fprofile-arcs -ftest-coverage" - CACHE STRING "Flags used by the C compiler during coverage builds." - FORCE ) -SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE - "" - CACHE STRING "Flags used for linking binaries during coverage builds." - FORCE ) -SET(CMAKE_SHARED_LINKER_FLAGS_COVERAGE - "" - CACHE STRING "Flags used by the shared libraries linker during coverage builds." - FORCE ) -MARK_AS_ADVANCED( - CMAKE_CXX_FLAGS_COVERAGE - CMAKE_C_FLAGS_COVERAGE - CMAKE_EXE_LINKER_FLAGS_COVERAGE - CMAKE_SHARED_LINKER_FLAGS_COVERAGE ) - IF ( NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "Coverage")) MESSAGE( WARNING "Code coverage results with an optimized (non-Debug) build may be misleading" ) ENDIF() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug" diff --git a/cmake/Modules/GrBuildTypes.cmake b/cmake/Modules/GrBuildTypes.cmake index 15b7339136..32d72e5690 100644 --- a/cmake/Modules/GrBuildTypes.cmake +++ b/cmake/Modules/GrBuildTypes.cmake @@ -70,9 +70,8 @@ endfunction(GR_CHECK_BUILD_TYPE) # -DCMAKE_BUILD_TYPE=Coverage # # This type uses no optimization (-O0), outputs debug symbols (-g) and -# outputs all intermediary files the build system produces, including -# all assembly (.s) files. Look in the build directory for these -# files. +# creates .gcda files while running functions in built executables and +# libraries. # NOTE: This is not defined on Windows systems. ######################################################################## if(NOT WIN32) @@ -81,10 +80,10 @@ if(NOT WIN32) SET(CMAKE_C_FLAGS_COVERAGE "-Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage" CACHE STRING "Flags used by the C compiler during Coverage builds." FORCE) SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE - "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING + "-Wl,--warn-unresolved-symbols,--warn-once,-lgcov" CACHE STRING "Flags used for linking binaries during Coverage builds." FORCE) SET(CMAKE_SHARED_LINKER_FLAGS_COVERAGE - "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING + "-Wl,--warn-unresolved-symbols,--warn-once,-lgcov" CACHE STRING "Flags used by the shared lib linker during Coverage builds." FORCE) MARK_AS_ADVANCED( |