aboutsummaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2019-11-19 17:58:36 +0100
committerFlorin Coras <florin.coras@gmail.com>2019-11-22 19:01:44 +0000
commit952a7b8b74be7fd237e6c0ccfe423876aa7e7b3e (patch)
tree0681ec07a14b80604d8e7e13ba14178360c71c30 /src/CMakeLists.txt
parent7bd1fd776fe6f6543da0c67830c26b67ff9d2dd3 (diff)
build: add build types helpstring to cmake project
Type: feature Change-Id: Ia016fee107859d5ad22fe7959c8e9d32758e0787 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
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
##############################################################################