From 952a7b8b74be7fd237e6c0ccfe423876aa7e7b3e Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Tue, 19 Nov 2019 17:58:36 +0100 Subject: [PATCH] build: add build types helpstring to cmake project Type: feature Change-Id: Ia016fee107859d5ad22fe7959c8e9d32758e0787 Signed-off-by: Damjan Marion --- src/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b8ffc0783db..4fa9e5a9b66 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -61,6 +61,7 @@ if (compiler_flag_no_address_of_packed_member) endif() # release +list(APPEND BUILD_TYPES "release") string(CONCAT CMAKE_C_FLAGS_RELEASE "-O2 " "-fstack-protector " @@ -71,6 +72,7 @@ string(CONCAT CMAKE_C_FLAGS_RELEASE string(CONCAT CMAKE_EXE_LINKER_FLAGS_RELEASE "-pie") # debug +list(APPEND BUILD_TYPES "debug") string(CONCAT CMAKE_C_FLAGS_DEBUG "-O0 " "-DCLIB_DEBUG " @@ -80,9 +82,11 @@ string(CONCAT CMAKE_C_FLAGS_DEBUG ) # coverity +list(APPEND BUILD_TYPES "coverity") string(CONCAT CMAKE_C_FLAGS_COVERITY "-O2 -D__COVERITY__") # gcov +list(APPEND BUILD_TYPES "gcov") string(CONCAT CMAKE_C_FLAGS_GCOV "-O0 " "-DCLIB_DEBUG " @@ -92,6 +96,11 @@ string(CONCAT CMAKE_C_FLAGS_GCOV string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UC) + +string(REPLACE ";" " " BUILD_TYPES "${BUILD_TYPES}") +set_property(CACHE CMAKE_BUILD_TYPE PROPERTY + HELPSTRING "Build type - valid options are: ${BUILD_TYPES}") + ############################################################################## # install config ############################################################################## -- 2.16.6