summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-06-08 13:33:47 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-08 17:24:00 +0200
commitdb95653246560c24ad3c8cb224b3d9321b50af0a (patch)
treeabdb6b98405e1f7642fadf8114d198ad86bdf279 /CMakeLists.txt
parent11369e6592800fcf03138b109fee3d4c0736f21a (diff)
cpp, simple wrappers for most of what we need, ivi_* still incomplete
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 791e645..cc6c88a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,9 +40,16 @@ macro(wlproto var_basename proto_xml_basename)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
endmacro()
-add_definitions(-D_GNU_SOURCE)
+add_definitions(-D_GNU_SOURCE -DDEBUG_OUTPUT)
set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused-parameter -std=c99 ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -std=c++14 ${CMAKE_CXX_FLAGS}")
+set(SANITIZER_MODE "none" CACHE STRING "Build using a specific sanitizer (e.g. 'address', 'thread', 'leak', 'undefined'), depends on compiler; default none")
+if (NOT ${SANITIZER_MODE} STREQUAL "none" AND NOT ${SANITIZER_MODE} STREQUAL "")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=${SANITIZER_MODE} -g -fno-omit-frame-pointer")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${SANITIZER_MODE} -g")
+ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=${SANITIZER_MODE} -g")
+endif()
+
add_subdirectory(src)