From bfdcad485d818be674baacf22257ad6280904bbf Mon Sep 17 00:00:00 2001 From: Baruch Siach Date: Wed, 20 Jul 2022 17:49:30 +0300 Subject: [PATCH] package/cjson: add option to build cJSON_Utils cJSON_Utils adds support for a few additional JSON RFCs. The size increase is small (around 12K for ARM32), but it is more than half the size of cJSON itself. So add a separate config option for cJSON_Utils. Cc: Danomi Manchego Signed-off-by: Baruch Siach Signed-off-by: Thomas Petazzoni --- package/cjson/Config.in | 11 +++++++++++ package/cjson/cjson.mk | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/package/cjson/Config.in b/package/cjson/Config.in index ee18fced5c..55262a0990 100644 --- a/package/cjson/Config.in +++ b/package/cjson/Config.in @@ -5,3 +5,14 @@ config BR2_PACKAGE_CJSON ANSI-C compliant JSON parser, under MIT license. https://github.com/DaveGamble/cJSON + +if BR2_PACKAGE_CJSON + +config BR2_PACKAGE_CJSON_UTILS + bool "cJSON utils" + help + Supplementary library with support for JSON Pointer + (RFC-6901), JSON Patch (RFC-6902), JSON Merge Patch + (RFC-7386), and more. + +endif diff --git a/package/cjson/cjson.mk b/package/cjson/cjson.mk index ac8db5701f..ad9d76a4ba 100644 --- a/package/cjson/cjson.mk +++ b/package/cjson/cjson.mk @@ -25,4 +25,10 @@ else CJSON_CONF_OPTS += -DBUILD_SHARED_AND_STATIC_LIBS=OFF endif +ifeq ($(BR2_PACKAGE_CJSON_UTILS),y) +CJSON_CONF_OPTS += -DENABLE_CJSON_UTILS=ON +else +CJSON_CONF_OPTS += -DENABLE_CJSON_UTILS=OFF +endif + $(eval $(cmake-package))