|
@@ -35,7 +35,23 @@ set(CMAKE_CXX_STANDARD 14)
|
|
|
## set(CMAKE_CXX_STANDARD 17)
|
|
|
set(CMAKE_CXX_EXTENSIONS ON)
|
|
|
|
|
|
-set(DISABLE_BUFFER_DEBUG ON CACHE BOOL "Turn off buffer debugging")
|
|
|
+# Are you debugging a buffer issue? If so, turn this to OFF.
|
|
|
+# This creates HUGE log files. Not for production!
|
|
|
+
|
|
|
+set(DISABLE_BUFFER_DEBUG ON CACHE BOOL "Turn off buffer debugging" FORCE)
|
|
|
+
|
|
|
+# Always disable in Release build.
|
|
|
+if((CMAKE_BUILD_TYPE STREQUAL Release) OR (CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo))
|
|
|
+message("Release build -- disable BUFFER DEBUG.")
|
|
|
+set(DISABLE_BUFFER_DEBUG ON CACHE BOOL "Turn off buffer debugging" FORCE)
|
|
|
+endif()
|
|
|
+
|
|
|
+# Display at configuration time what settings we're using.
|
|
|
+if(DISABLE_BUFFER_DEBUG)
|
|
|
+message("BUFFER DEBUG DISABLED (Good!)")
|
|
|
+else()
|
|
|
+message("WARNING: Big logs ahead! BUFFER DEBUG is ENABLED")
|
|
|
+endif()
|
|
|
|
|
|
# Enable testing
|
|
|
# set(BUILD_TESTING ON)
|
|
@@ -57,7 +73,7 @@ add_test(NAME test-lastseen
|
|
|
add_executable(test-utils test-utils.cpp utils.cpp)
|
|
|
add_dependencies(test-utils gtest)
|
|
|
target_link_libraries(test-utils gtest_main)
|
|
|
-if(${DISABLE_BUFFER_DEBUG})
|
|
|
+if(DISABLE_BUFFER_DEBUG)
|
|
|
target_compile_definitions(test-utils PUBLIC NO_BUFFER_DEBUG=1)
|
|
|
endif()
|
|
|
|
|
@@ -68,7 +84,7 @@ add_executable(test-render test-render.cpp render.cpp terminal.cpp utils.cpp)
|
|
|
add_dependencies(test-render gtest)
|
|
|
target_link_libraries(test-render gtest_main)
|
|
|
target_link_libraries(test-render zf_log)
|
|
|
-if(${DISABLE_BUFFER_DEBUG})
|
|
|
+if(DISABLE_BUFFER_DEBUG)
|
|
|
target_compile_definitions(test-render PUBLIC NO_BUFFER_DEBUG=1)
|
|
|
endif()
|
|
|
|
|
@@ -76,7 +92,7 @@ add_executable(test-mangle test-mangle.cpp wordplay.cpp render.cpp terminal.cpp
|
|
|
add_dependencies(test-mangle gtest)
|
|
|
target_link_libraries(test-mangle gtest_main)
|
|
|
target_link_libraries(test-mangle zf_log)
|
|
|
-if(${DISABLE_BUFFER_DEBUG})
|
|
|
+if(DISABLE_BUFFER_DEBUG)
|
|
|
target_compile_definitions(test-mangle PUBLIC NO_BUFFER_DEBUG=1)
|
|
|
endif()
|
|
|
|
|
@@ -125,7 +141,7 @@ target_link_libraries(hharry util)
|
|
|
target_link_libraries(hharry zf_log)
|
|
|
# target_compile_definitions(hharry PUBLIC ZF_LOG_DEF_LEVEL=ZF_LOG_INFO)
|
|
|
target_compile_definitions(hharry PUBLIC ZF_LOG_DEF_LEVEL=ZF_LOG_VERBOSE)
|
|
|
-if(${DISABLE_BUFFER_DEBUG})
|
|
|
+if(DISABLE_BUFFER_DEBUG)
|
|
|
target_compile_definitions(hharry PUBLIC NO_BUFFER_DEBUG=1)
|
|
|
endif()
|
|
|
|
|
@@ -133,13 +149,13 @@ add_executable(try-re try-re.c)
|
|
|
|
|
|
add_executable(ansi-color ansi-color.c)
|
|
|
add_executable(ansi-to-src ansi-to-src.cpp utils.cpp)
|
|
|
-if(${DISABLE_BUFFER_DEBUG})
|
|
|
+if(DISABLE_BUFFER_DEBUG)
|
|
|
target_compile_definitions(ansi-to-src PUBLIC NO_BUFFER_DEBUG=1)
|
|
|
endif()
|
|
|
|
|
|
add_executable(images images.cpp utils.cpp images.h)
|
|
|
target_link_libraries(images zf_log)
|
|
|
-if(${DISABLE_BUFFER_DEBUG})
|
|
|
+if(DISABLE_BUFFER_DEBUG)
|
|
|
target_compile_definitions(images PUBLIC NO_BUFFER_DEBUG=1)
|
|
|
endif()
|
|
|
|