diff --git a/CMakeLists.txt b/CMakeLists.txt index f300cd90..fb130ce8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,14 +26,23 @@ set(CMAKE_MACOSX_RPATH ON) option(DEBUG "Enable assertions and other debugging facilities" OFF) if(DEBUG) + set(MIN_LOGGER_LEVEL DEBUG) add_definitions(-DTOX_DEBUG=1) - add_definitions(-DMIN_LOGGER_LEVEL=LOG_TRACE) check_c_compiler_flag("-g3" HAVE_G3) if(HAVE_G3) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3") endif() endif() +option(TRACE "Enable TRACE level logging (expensive, for network debugging)" OFF) +if(TRACE) + set(MIN_LOGGER_LEVEL TRACE) +endif() + +if(MIN_LOGGER_LEVEL) + add_definitions(-DMIN_LOGGER_LEVEL=LOG_${MIN_LOGGER_LEVEL}) +endif() + option(ASSOC_DHT "Enable module to store currently unused ID <=> IP associations" OFF) if(ASSOC_DHT) add_definitions(-DENABLE_ASSOC_DHT=1) diff --git a/other/travis/toxcore-script b/other/travis/toxcore-script index e023ff81..88a927b6 100755 --- a/other/travis/toxcore-script +++ b/other/travis/toxcore-script @@ -6,15 +6,17 @@ export CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" # Build toxcore and run tests. # TODO(iphydf): Enable ASAN. It currently has some bad interactions with gcov, # so it's disabled on Travis. -RUN $CMAKE \ - -B$BUILD_DIR \ - -H. \ - -DCMAKE_INSTALL_PREFIX:PATH=$CURDIR/_install \ - -DDEBUG=ON \ - -DASSOC_DHT=ON \ - -DSTRICT_ABI=ON \ - -DTEST_TIMEOUT_SECONDS=300 \ - $CMAKE_EXTRA_FLAGS #-DASAN=ON +RUN $CMAKE \ + -B$BUILD_DIR \ + -H. \ + -DCMAKE_INSTALL_PREFIX:PATH=$CURDIR/_install \ + -DASSOC_DHT=ON \ + -DDEBUG=ON \ + -DSTRICT_ABI=ON \ + -DTEST_TIMEOUT_SECONDS=300 \ + -DTRACE=ON \ + $CMAKE_EXTRA_FLAGS \ + #-DASAN=ON export CTEST_OUTPUT_ON_FAILURE=1