summaryrefslogtreecommitdiff
path: root/cmake/Modules/GrBuildTypes.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/Modules/GrBuildTypes.cmake')
-rw-r--r--cmake/Modules/GrBuildTypes.cmake33
1 files changed, 32 insertions, 1 deletions
diff --git a/cmake/Modules/GrBuildTypes.cmake b/cmake/Modules/GrBuildTypes.cmake
index 34614c9d08..5789d88934 100644
--- a/cmake/Modules/GrBuildTypes.cmake
+++ b/cmake/Modules/GrBuildTypes.cmake
@@ -38,7 +38,7 @@ set(__INCLUDED_GR_BUILD_TYPES_CMAKE TRUE)
# build type below, make sure to add it to this list.
list(APPEND AVAIL_BUILDTYPES
None Debug Release RelWithDebInfo MinSizeRel
- NoOptWithASM O2WithASM O3WithASM
+ Coverage NoOptWithASM O2WithASM O3WithASM
)
########################################################################
@@ -67,6 +67,37 @@ endfunction(GR_CHECK_BUILD_TYPE)
########################################################################
# For GCC and Clang, we can set a 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.
+# NOTE: This is not defined on Windows systems.
+########################################################################
+if(NOT WIN32)
+ SET(CMAKE_CXX_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_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
+ "Flags used for linking binaries during Coverage builds." FORCE)
+ SET(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
+ "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
+ "Flags used by the shared lib 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)
+endif(NOT WIN32)
+
+
+########################################################################
+# For GCC and Clang, we can set a build type:
+#
# -DCMAKE_BUILD_TYPE=NoOptWithASM
#
# This type uses no optimization (-O0), outputs debug symbols (-g) and