summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authordbiastoch <dbiastoch@de.adit-jv.com>2021-01-13 11:27:17 +0100
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2021-06-30 10:54:59 +0900
commit442688504260bb2bfcfb08a9865f223d2ab2d19a (patch)
treedeb6e007dfd727d0ec91430cac8ec9cd27e03b7e /CMakeLists.txt
parentf5a22d09b620be0c911815145f0e6486f061aecd (diff)
downloadDLT-daemon-442688504260bb2bfcfb08a9865f223d2ab2d19a.tar.gz
dlt-receive: Enabled more filtering by using json filter files
-Added '-j' flag to dlt-receive for reading a json filter file -Added more attributes to DltFilter (LogLevel, MaxPayload, MinPayload) for extended message filtering, when using old filters these values are set to default. Same behaviour, when they are not defined in json filter file. -extended dlt_common.c to support json filter files and new DltFilter attributes +add dlt_json_filter_load to parse a json filter file into a DltFilter +add dlt_json_filter_save to print a DltFilter into a json file -Two new libraries are used to parse the json filter files: json-c for Linux based systems and the QNX internal libjson for QNX systems -gtest_dlt_common was modified to test the new function 'dlt_json_filter_load' +add testfile_extended.dlt that contains a bigger varity of messages (different context/app IDs, lengths and log levels) +add testfilter.json which is a valid json filter file -New dependency on library was added to related CMakeLists and is described in README.md Signed-off-by: dbiastoch <dbiastoch@de.adit-jv.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 21 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9bc416a..1b47159 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -77,6 +77,7 @@ option(WITH_DLT_KPI "Set to ON to build src/kpi binaries"
option(WITH_DLT_FATAL_LOG_TRAP "Set to ON to enable DLT_LOG_FATAL trap(trigger segv inside dlt-user library)" OFF)
option(WITH_UDP_CONNECTION "Set to ON to enable dlt UDP multicast SUPPORT" OFF)
option(WITH_LIB_SHORT_VERSION "Set to ON to build library with only major number in version" OFF)
+option(WITH_EXTENDED_FILTERING "Set to OFF to build without extended filtering. Using json filter files is only supported for Linux based system with json-c and QNX." ON)
option(WITH_DLT_DAEMON_VSOCK_IPC "Set to ON to enable VSOCK support in daemon" OFF)
option(WITH_DLT_LIB_VSOCK_IPC "Set to ON to enable VSOCK support in library (DLT_IPC is not used in library)" OFF)
@@ -235,6 +236,25 @@ if(WITH_DLT_FATAL_LOG_TRAP)
add_definitions(-DDLT_FATAL_LOG_RESET_ENABLE)
endif()
+if(WITH_DLT_FILTER_BACKEND_PROP)
+ add_definitions(-DHAS_PROPRIETARY_FILTER_BACKEND)
+endif()
+
+if(WITH_EXTENDED_FILTERING)
+ if(("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") OR ("${CMAKE_SYSTEM_NAME}" MATCHES "Android"))
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(JSON REQUIRED json-c)
+ set(DLT_JSON_LIBRARY ${JSON_LIBRARIES})
+ elseif("${CMAKE_SYSTEM_NAME}" MATCHES "QNX")
+ set(DLT_JSON_LIBRARY json)
+ else()
+ message(FATAL_ERROR "OS doesn't support extended filtering. Please build without cmake option '-DWITH_EXTENDED_FILTERING=OFF'")
+ endif()
+ add_definitions(-DEXTENDED_FILTERING)
+else()
+ set(DLT_JSON_LIBRARY "")
+endif()
+
add_subdirectory(doc)
add_subdirectory(src)
add_subdirectory(include/dlt)
@@ -302,6 +322,7 @@ message(STATUS "DLT_VSOCK_PORT = ${DLT_VSOCK_PORT}")
message(STATUS "WITH_UDP_CONNECTION = ${WITH_UDP_CONNECTION}")
message(STATUS "WITH_DLT_QNX_SYSTEM = ${WITH_DLT_QNX_SYSTEM}")
message(STATUS "WITH_LIB_SHORT_VERSION = ${WITH_LIB_SHORT_VERSION}")
+message(STATUS "WITH_EXTENDED_FILTERING = ${WITH_EXTENDED_FILTERING}")
message(STATUS "Change a value with: cmake -D<Variable>=<Value>")
message(STATUS "-------------------------------------------------------------------------------")
message(STATUS)