+# release
+list(APPEND BUILD_TYPES "release")
+string(CONCAT CMAKE_C_FLAGS_RELEASE
+ "-O2 "
+ "-fstack-protector "
+ "-DFORTIFY_SOURCE=2 "
+ "-fno-common "
+)
+
+string(CONCAT CMAKE_EXE_LINKER_FLAGS_RELEASE "-pie")
+
+# debug
+list(APPEND BUILD_TYPES "debug")
+string(CONCAT CMAKE_C_FLAGS_DEBUG
+ "-O0 "
+ "-DCLIB_DEBUG "
+ "-fstack-protector "
+ "-DFORTIFY_SOURCE=2 "
+ "-fno-common "
+)
+
+# 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 "
+ "-DCLIB_GCOV "
+ "-fprofile-arcs "
+ "-ftest-coverage ")
+
+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}")
+