diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e3aa50..fb668b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/") # Options SET(LIBNFC_DEBUG_OUTPUT OFF CACHE BOOL "Debug output of communication with the NFC chip") IF(LIBNFC_DEBUG_OUTPUT) - ADD_DEFINITIONS(-DDEBUG -g3) + ADD_DEFINITIONS(-DDEBUG -DLOG -g3) ENDIF(LIBNFC_DEBUG_OUTPUT) # Doxygen diff --git a/libnfc/log-printf.c b/libnfc/log-printf.c index 200ecf8..75c5e27 100644 --- a/libnfc/log-printf.c +++ b/libnfc/log-printf.c @@ -25,6 +25,12 @@ #include #include +#ifndef LOG + // Leaving in a preprocessor error, as the build system should skip this + // file otherwise. + #error "No logging defined, but log-printf.c still compiled." +#else // LOG + void log_init(const nfc_context *context) { @@ -67,3 +73,5 @@ log_put(const uint8_t group, const char *category, const uint8_t priority, const } } } + +#endif // LOG