aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-06-19 13:51:12 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-08 17:24:00 +0200
commitc78a62c85c55e5bd8683792dbf86b6188349d921 (patch)
tree31c1540287f8055d08bf9f337b01d9ae537f87e8 /CMakeLists.txt
parent6cbdcf493969b1f819a34d087f2fa306090b76c7 (diff)
cmake: introduce ENABLE_DEBUG_OUTPUT cmake cache variable
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 ed26d05..1654333 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,7 +40,14 @@ macro(wlproto var_basename proto_xml_basename)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
endmacro()
-add_definitions(-D_GNU_SOURCE -DDEBUG_OUTPUT)
+set(ENABLE_DEBUG_OUTPUT OFF CACHE BOOL "Enable debug logging")
+if(ENABLE_DEBUG_OUTPUT)
+ add_definitions(-DDEBUG_OUTPUT)
+else()
+ remove_definitions(-DDEBUG_OUTPUT)
+endif()
+
+add_definitions(-D_GNU_SOURCE)
set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-comment -Wno-unused-parameter -fvisibility=hidden -std=c99 ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-comment -Wno-unused-parameter -fvisibility=hidden -std=c++14 ${CMAKE_CXX_FLAGS}")