diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
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}") |
83 | endif() | 83 | endif() |
84 | 84 | ||
85 | option(EXECUTION_TRACE "Print a function trace during execution (for debugging)" OFF) | ||
86 | if(EXECUTION_TRACE) | ||
87 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -finstrument-functions") | ||
88 | endif() | ||
89 | |||
85 | set(MIN_LOGGER_LEVEL "" CACHE STRING "Logging level to use (TRACE, DEBUG, INFO, WARNING, ERROR)") | 90 | set(MIN_LOGGER_LEVEL "" CACHE STRING "Logging level to use (TRACE, DEBUG, INFO, WARNING, ERROR)") |
86 | if(MIN_LOGGER_LEVEL) | 91 | if(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 | ||
363 | add_library(misc_tools | 368 | set(misc_tools_SOURCES |
364 | testing/misc_tools.c | 369 | testing/misc_tools.c |
365 | testing/misc_tools.h) | 370 | testing/misc_tools.h) |
371 | if(EXECUTION_TRACE) | ||
372 | set(misc_tools_SOURCES ${misc_tools_SOURCES} | ||
373 | testing/trace.cc) | ||
374 | endif() | ||
375 | add_library(misc_tools ${misc_tools_SOURCES}) | ||
366 | target_link_modules(misc_tools toxcore) | 376 | target_link_modules(misc_tools toxcore) |
367 | 377 | ||
368 | set(TEST_TIMEOUT_SECONDS "" CACHE STRING "Limit runtime of each test to the number of seconds specified") | 378 | set(TEST_TIMEOUT_SECONDS "" CACHE STRING "Limit runtime of each test to the number of seconds specified") |