summaryrefslogtreecommitdiffstats
path: root/cmake/cmake.d/01-build_options.cmake
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-10-23 20:54:01 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-23 21:01:16 +0200
commit30b1ad67097fa5af762decede7d3928b2484c626 (patch)
tree8338dcd045def86dacce5a0f70d19c83f5df5760 /cmake/cmake.d/01-build_options.cmake
parent7923b338a466db596db23d62514a9ae3f0379d00 (diff)
Improving readability
Change-Id: I2f14f0304a5f40ddb146d779bc5c3aad94d872b6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'cmake/cmake.d/01-build_options.cmake')
-rw-r--r--cmake/cmake.d/01-build_options.cmake27
1 files changed, 22 insertions, 5 deletions
diff --git a/cmake/cmake.d/01-build_options.cmake b/cmake/cmake.d/01-build_options.cmake
index d46d1d5..3b1eca7 100644
--- a/cmake/cmake.d/01-build_options.cmake
+++ b/cmake/cmake.d/01-build_options.cmake
@@ -88,10 +88,27 @@ endforeach()
# Compilation option depending on CMAKE_BUILD_TYPE
##################################################
-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 -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.")
+set(PROFILING_COMPILE_OPTIONS
+ -g
+ -O0
+ -pg
+ -Wp,-U_FORTIFY_SOURCE
+ CACHE STRING "Compilation flags for PROFILING build type.")
+set(DEBUG_COMPILE_OPTIONS
+ -g
+ -O0
+ -ggdb
+ CACHE STRING "Compilation flags for DEBUG 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}>)
endforeach()
@@ -119,7 +136,7 @@ endforeach(PKG_CONFIG)
IF(CMAKE_BUILD_TYPE MATCHES DEBUG AND USE_EFENCE)
CHECK_LIBRARY_EXISTS(efence malloc "" HAVE_LIBEFENCE)
IF(HAVE_LIBEFENCE)
- MESSAGE(STATUS "Linking with ElectricFence for debugging purposes...")
+ MESSAGE("Linking with ElectricFence for debugging purposes...")
SET(libefence_LIBRARIES "-lefence")
list (APPEND link_libraries ${libefence_LIBRARIES})
ENDIF(HAVE_LIBEFENCE)