From 4f4f6cd6dcdf8d37710b34bf71bf684af2fa86e4 Mon Sep 17 00:00:00 2001 From: Zhouheng Zheng Date: Wed, 20 Dec 2023 21:26:42 +0800 Subject: [PATCH] Add json third party when support node trace db (#670) Type: Code Improvement --- CMakeLists.txt | 1 + src/tim/CMakeLists.txt | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f77c8c4aa..1ac8e4b1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ option(TIM_VX_ENABLE_GRPC "Enable gPRC support" option(TIM_VX_DBG_ENABLE_TENSOR_HNDL "Enable built-in tensor from handle: use malloced memory instead of VideoMemory by kernel driver" ON) option(TIM_VX_ENABLE_TENSOR_CACHE "Enable tensor cache for const tensor" OFF) option(TIM_VX_ENABLE_API_TRACE "Enable trace and replay of graph apis" OFF) +option(TIM_VX_ENABLE_NODE_TRACE "Enable node trace support" OFF) set(CMAKE_CXX_STANDARD 14) set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/src/tim/CMakeLists.txt b/src/tim/CMakeLists.txt index 181aeebe7..8b38b33b3 100644 --- a/src/tim/CMakeLists.txt +++ b/src/tim/CMakeLists.txt @@ -246,4 +246,21 @@ if(TIM_VX_ENABLE_TEST) install(TARGETS unit_test DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}) endif() +if(TIM_VX_ENABLE_NODE_TRACE) + include(FetchContent) + FetchContent_Declare( + jsoncpp + GIT_REPOSITORY https://github.com/open-source-parsers/jsoncpp.git + GIT_TAG master + ) + + FetchContent_GetProperties(jsoncpp) + if(NOT jsoncpp_POPULATED) + FetchContent_Populate(jsoncpp) + add_subdirectory(${jsoncpp_SOURCE_DIR} ${jsoncpp_BINARY_DIR}) + endif() + target_link_libraries(${TARGET_NAME} PUBLIC ${jsoncpp_BINARY_DIR}/src/lib_json/libjsoncpp.so) + target_include_directories(${TARGET_NAME} PUBLIC ${jsoncpp_SOURCE_DIR}/include) +endif() + add_subdirectory("utils")