summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f108e2b1..73f66cf1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,6 +82,11 @@ else()
82 message(STATUS "Supported C++ compiler features = ${CMAKE_CXX_COMPILE_FEATURES}") 82 message(STATUS "Supported C++ compiler features = ${CMAKE_CXX_COMPILE_FEATURES}")
83endif() 83endif()
84 84
85option(EXECUTION_TRACE "Print a function trace during execution (for debugging)" OFF)
86if(EXECUTION_TRACE)
87 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -finstrument-functions")
88endif()
89
85set(MIN_LOGGER_LEVEL "" CACHE STRING "Logging level to use (TRACE, DEBUG, INFO, WARNING, ERROR)") 90set(MIN_LOGGER_LEVEL "" CACHE STRING "Logging level to use (TRACE, DEBUG, INFO, WARNING, ERROR)")
86if(MIN_LOGGER_LEVEL) 91if(MIN_LOGGER_LEVEL)
87 if(("${MIN_LOGGER_LEVEL}" STREQUAL "TRACE") OR 92 if(("${MIN_LOGGER_LEVEL}" STREQUAL "TRACE") OR
@@ -360,9 +365,14 @@ unit_test(toxcore util)
360# 365#
361################################################################################ 366################################################################################
362 367
363add_library(misc_tools 368set(misc_tools_SOURCES
364 testing/misc_tools.c 369 testing/misc_tools.c
365 testing/misc_tools.h) 370 testing/misc_tools.h)
371if(EXECUTION_TRACE)
372 set(misc_tools_SOURCES ${misc_tools_SOURCES}
373 testing/trace.cc)
374endif()
375add_library(misc_tools ${misc_tools_SOURCES})
366target_link_modules(misc_tools toxcore) 376target_link_modules(misc_tools toxcore)
367 377
368set(TEST_TIMEOUT_SECONDS "" CACHE STRING "Limit runtime of each test to the number of seconds specified") 378set(TEST_TIMEOUT_SECONDS "" CACHE STRING "Limit runtime of each test to the number of seconds specified")