2025-09-22 21:30:14 -04:00
|
|
|
# DebugOpts.cmake - Debug configuration options
|
|
|
|
|
|
|
|
|
|
# Enable debug locking features
|
|
|
|
|
option(ENABLE_DEBUG_LOCKS "Enable debug features for locking system" ON)
|
|
|
|
|
|
2025-11-06 21:40:32 -04:00
|
|
|
# Enable callable tracing for debugging boost::asio post operations
|
|
|
|
|
option(ENABLE_DEBUG_TRACE_CALLABLES "Enable callable tracing for debugging boost::asio post operations" OFF)
|
|
|
|
|
|
2025-09-22 21:30:14 -04:00
|
|
|
# Qutex deadlock detection configuration
|
|
|
|
|
# Always define the variable in cache so it appears in ccmake
|
|
|
|
|
set(DEBUG_QUTEX_DEADLOCK_TIMEOUT_MS 500 CACHE STRING
|
|
|
|
|
"Timeout in milliseconds for deadlock detection in qutex system")
|
|
|
|
|
|
|
|
|
|
if(ENABLE_DEBUG_LOCKS)
|
|
|
|
|
# Validate the timeout value
|
|
|
|
|
if(NOT DEBUG_QUTEX_DEADLOCK_TIMEOUT_MS OR DEBUG_QUTEX_DEADLOCK_TIMEOUT_MS STREQUAL "")
|
|
|
|
|
message(FATAL_ERROR "DEBUG_QUTEX_DEADLOCK_TIMEOUT_MS must be a positive integer > 0")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# Convert to integer and validate
|
|
|
|
|
math(EXPR timeout_int "${DEBUG_QUTEX_DEADLOCK_TIMEOUT_MS}")
|
|
|
|
|
if(timeout_int LESS_EQUAL 0)
|
|
|
|
|
message(FATAL_ERROR "DEBUG_QUTEX_DEADLOCK_TIMEOUT_MS must be a positive integer > 0")
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|