summaryrefslogtreecommitdiffstats
path: root/cmake/cmake.d
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-10-11 14:01:20 +0800
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-23 20:54:23 +0200
commitff260030bb59b39e19d305224b6200f276a237cf (patch)
treedbd7f44ace10a6a8cc2b23a1ecac5b029f5e70bd /cmake/cmake.d
parente1896191f8c10ea7d02d97b52184f99dfb2307f5 (diff)
cmake: coverage: disable compiler optimization for COVERAGE build
Switch to -O0 compile option to allow more accurate coverage reports that function inlining and OOO execution can skew. Bug-AGL: SPEC-1807 Change-Id: If3ea7e9fe931ac9087d4c4966d0b3ca77308eaf7 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'cmake/cmake.d')
-rw-r--r--cmake/cmake.d/01-build_options.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/cmake.d/01-build_options.cmake b/cmake/cmake.d/01-build_options.cmake
index c150d2a..d46d1d5 100644
--- a/cmake/cmake.d/01-build_options.cmake
+++ b/cmake/cmake.d/01-build_options.cmake
@@ -90,7 +90,7 @@ endforeach()
##################################################
set(PROFILING_COMPILE_OPTIONS -g -O0 -pg -Wp,-U_FORTIFY_SOURCE CACHE STRING "Compilation flags for PROFILING build type.")
set(DEBUG_COMPILE_OPTIONS -g -ggdb CACHE STRING "Compilation flags for DEBUG build type.")
-set(COVERAGE_COMPILE_OPTIONS -g --coverage CACHE STRING "Compilation flags for COVERAGE build type.")
+set(COVERAGE_COMPILE_OPTIONS -g -O0 --coverage CACHE STRING "Compilation flags for COVERAGE build type.")
set(RELEASE_COMPILE_OPTIONS -O2 -D_FORTIFY_SOURCE=2 CACHE STRING "Compilation flags for RELEASE build type.")
foreach(option ${PROFILING_COMPILE_OPTIONS})
add_compile_options($<$<CONFIG:PROFILING>:${option}>)