cjson: build shared and static library
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Sun, 31 Dec 2017 16:29:33 +0000 (17:29 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 3 Jan 2018 21:08:30 +0000 (22:08 +0100)
cjson 1.6.0 added the BUILD_SHARED_AND_STATIC_LIBS option which is OFF
by default so set it depending on BR2_SHARED_STATIC_LIBS value.

If BUILD_SHARED_AND_STATIC_LIBS is set to OFF, cjson uses the standard
BUILD_SHARED_LIBS option which is passed by the cmake-package
infrastructure.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/cjson/cjson.mk

index f3ef7fd2ac8d2c76aa4e0100eb573c96a8362d7c..aabf3677eadcfe6cd618025c09877467f40bd559 100644 (file)
@@ -15,4 +15,10 @@ CJSON_CONF_OPTS += \
        -DENABLE_CJSON_TEST=OFF \
        -DENABLE_CUSTOM_COMPILER_FLAGS=OFF
 
+ifeq ($(BR2_SHARED_STATIC_LIBS),y)
+CJSON_CONF_OPTS += -DBUILD_SHARED_AND_STATIC_LIBS=ON
+else
+CJSON_CONF_OPTS += -DBUILD_SHARED_AND_STATIC_LIBS=OFF
+endif
+
 $(eval $(cmake-package))