jsonfilter: drop legacy json-c support
authorSergey Ponomarev <stokito@gmail.com>
Tue, 19 Jan 2021 07:14:16 +0000 (09:14 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Wed, 29 Jun 2022 00:14:32 +0000 (02:14 +0200)
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 <stokito@gmail.com>
[ wrapped commit description to 75 char limit ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
CMakeLists.txt

index 7361eb246c94f93d829c55d291883edd81f1eab0..dbfbf5d8f26ffe35808f0e6c40d033439f1ee46d 100644 (file)
@@ -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)