From: Sergey Ponomarev Date: Tue, 19 Jan 2021 07:14:16 +0000 (+0200) Subject: jsonfilter: drop legacy json-c support X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=013b75ab0598e84be84aa6eda79827c12265988f;p=project%2Fjsonpath.git jsonfilter: drop legacy json-c support The cmake logic is wrong (E.G. PKG_CHECK_FOR_MODULES fails unless all modules are found), and the legacy libjson.so name is also used by the other libjson (for example [1]) which provides an incompatible API, so just drop it. Backported from libubox cbf80de7f4df61960f386cb01a899cf4228d38f3 [1] http://sourceforge.net/projects/libjson/ Signed-off-by: Sergey Ponomarev [ wrapped commit description to 75 char limit ] Signed-off-by: Christian Marangi --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 7361eb2..dbfbf5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,14 +7,12 @@ IF(NOT APPLE) SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,--gc-sections") ENDIF() -find_library(json NAMES json-c json) - IF(DEBUG) ADD_DEFINITIONS(-DDEBUG -g3) ENDIF() INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(JSONC json-c json) +PKG_CHECK_MODULES(JSONC json-c) IF(JSONC_FOUND) ADD_DEFINITIONS(-DJSONC) INCLUDE_DIRECTORIES(${JSONC_INCLUDE_DIRS}) @@ -40,6 +38,7 @@ INCLUDE_DIRECTORIES(${ubox_include_dir}) SET_PROPERTY(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "lemon;parser.h;parser.out") SET_SOURCE_FILES_PROPERTIES("parser.c" PROPERTIES GENERATED TRUE) ADD_EXECUTABLE(jsonpath main.c ast.c lexer.c parser.c matcher.c) +find_library(json NAMES json-c) TARGET_LINK_LIBRARIES(jsonpath ubox ${json}) INSTALL(TARGETS jsonpath RUNTIME DESTINATION bin)