summaryrefslogtreecommitdiffstats
path: root/cmake/cmake.d/04-build_options.cmake
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-07-05 16:56:00 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-15 18:22:47 +0200
commitd44c78c0b4d72bbc85c9261a7664c1ea1fad2539 (patch)
treef4bb747df22c05ec409f24e647f7f27b8508de9f /cmake/cmake.d/04-build_options.cmake
parent989eb4b774d941a0b6192917e76bd422bae968d2 (diff)
Changes build flags to be more accurate
Change-Id: I1139845c4d103935c75dbd24ab6a4c38d121bdea Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'cmake/cmake.d/04-build_options.cmake')
-rw-r--r--cmake/cmake.d/04-build_options.cmake15
1 files changed, 7 insertions, 8 deletions
diff --git a/cmake/cmake.d/04-build_options.cmake b/cmake/cmake.d/04-build_options.cmake
index 1aa046a..aacad64 100644
--- a/cmake/cmake.d/04-build_options.cmake
+++ b/cmake/cmake.d/04-build_options.cmake
@@ -71,21 +71,20 @@ add_compile_options(-Werror=maybe-uninitialized)
add_compile_options(-Werror=implicit-function-declaration)
add_compile_options(-ffunction-sections -fdata-sections)
add_compile_options(-fPIC)
-add_compile_options(-g)
-set(CMAKE_C_FLAGS_PROFILING "-g -O2 -pg -Wp,-U_FORTIFY_SOURCE" CACHE STRING "Flags for profiling")
-set(CMAKE_C_FLAGS_DEBUG "-g -O2 -ggdb -Wp,-U_FORTIFY_SOURCE" CACHE STRING "Flags for debugging")
+set(CMAKE_C_FLAGS_PROFILING "-g -O0 -pg -Wp,-U_FORTIFY_SOURCE" CACHE STRING "Flags for profiling")
+set(CMAKE_C_FLAGS_DEBUG "-g -Og -ggdb -Wp,-U_FORTIFY_SOURCE" CACHE STRING "Flags for debugging")
set(CMAKE_C_FLAGS_RELEASE "-O2" CACHE STRING "Flags for releasing")
set(CMAKE_C_FLAGS_CCOV "-g -O2 --coverage" CACHE STRING "Flags for coverage test")
-set(CMAKE_CXX_FLAGS_PROFILING "-g -O0 -pg -Wp,-U_FORTIFY_SOURCE")
-set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
-set(CMAKE_CXX_FLAGS_RELEASE "-g -O2")
-set(CMAKE_CXX_FLAGS_CCOV "-g -O2 --coverage")
+set(CMAKE_CXX_FLAGS_PROFILING "-g -O0 -pg -Wp,-U_FORTIFY_SOURCE" CACHE STRING "Flags for profiling")
+set(CMAKE_CXX_FLAGS_DEBUG "-g -Og -ggdb -Wp,-U_FORTIFY_SOURCE" CACHE STRING "Flags for debugging")
+set(CMAKE_CXX_FLAGS_RELEASE "-O2" CACHE STRING "Flags for releasing")
+set(CMAKE_CXX_FLAGS_CCOV "-g -O2 --coverage" CACHE STRING "Flags for coverage test")
# Env variable overload default
if(DEFINED ENV{INSTALL_PREFIX})
- set (INSTALL_PREFIX $ENV{INSTALL_PREFIX})
+ set(INSTALL_PREFIX $ENV{INSTALL_PREFIX} CACHE PATH "The path where to install")
else()
set(INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/Install" CACHE PATH "The path where to install")
endif()