Skip to content

Commit

Permalink
Add json third party when support node trace db
Browse files Browse the repository at this point in the history
Type: Code Improvement
  • Loading branch information
zhengzhouheng committed Dec 20, 2023
1 parent 622c472 commit 21a3f5d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
17 changes: 17 additions & 0 deletions src/tim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit 21a3f5d

Please sign in to comment.