Add compiler flags to enable dev testing

This just adds compiler flags to CMakeLists.txt to be on par
with the autotools.

Tested: Manually invoked a developer build and verified

Signed-off-by: Sumanth Bhat <sumanth.bhat@linux.intel.com>
Change-Id: Ibb129c2055ad57af57b4bca4ac81590afd994f8d
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fa8999f..267c4e0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,22 @@
 cmake_minimum_required (VERSION 3.5 FATAL_ERROR)
 
+option(DEV "Option for developer testing" OFF)
+
+if(DEV)
+	set(CMAKE_C_FLAGS
+	"${CMAKE_C_FLAGS} \
+	-Werror \
+	-Wall \
+	-Wextra \
+	-Wnull-dereference \
+	-Wformat-security \
+	-Wno-type-limits \
+	-fsanitize=address,leak,undefined \
+	-ggdb \
+	")
+endif()
+
+
 add_definitions (-DMCTP_LOG_STDERR)
 add_definitions (-DMCTP_HAVE_FILEIO)
 add_definitions (-DMCTP_HAVE_STDIO)