blob: 6c8934b34258046791df19231adb1be5152bbcff [file] [log] [blame]
Patrick Williamsac13d5f2023-11-24 18:59:46 -06001DESCRIPTION = "Ultralightweight JSON parser in ANSI C"
2HOMEPAGE = "https://github.com/DaveGamble/cJSON"
3SECTION = "libs"
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=218947f77e8cb8e2fa02918dc41c50d0"
6
7SRC_URI = "git://github.com/DaveGamble/cJSON.git;branch=master;protocol=https \
8 file://run-ptest \
9 "
Patrick Williams169d7bc2024-01-05 11:33:25 -060010SRCREV = "87d8f0961a01bf09bef98ff89bae9fdec42181ee"
Patrick Williamsac13d5f2023-11-24 18:59:46 -060011
12S = "${WORKDIR}/git"
13
14inherit cmake pkgconfig ptest
15
16RDEPENDS:${PN}-ptest += "cmake"
17
18do_install_ptest() {
19 # create directories
20 install -d ${D}${PTEST_PATH} ${D}${PTEST_PATH}/tests ${D}${PTEST_PATH}/fuzzing
21 install -d ${D}${PTEST_PATH}/tests/inputs ${D}${PTEST_PATH}/tests/json-patch-tests
22 # CTestTestfiles.cmake contain fully defined path generated by cmake.
23 # Change the fully defined path to ptest path on the target
24 sed s#${B}#${PTEST_PATH}# ${B}/CTestTestfile.cmake > ${D}${PTEST_PATH}/CTestTestfile.cmake
25 sed s#${B}#${PTEST_PATH}# ${B}/tests/CTestTestfile.cmake > ${D}${PTEST_PATH}/tests/CTestTestfile.cmake
26 sed s#${B}#${PTEST_PATH}# ${B}/fuzzing/CTestTestfile.cmake > ${D}${PTEST_PATH}/fuzzing/CTestTestfile.cmake
27 # install test artifacts
28 install ${B}/cJSON_test ${D}${PTEST_PATH}
29 install ${B}/tests/cjson_add ${B}/tests/*_tests ${B}/tests/parse_* ${B}/tests/print_* ${B}/tests/readme_examples ${D}${PTEST_PATH}/tests/
30 install ${B}/tests/inputs/* ${D}${PTEST_PATH}/tests/inputs
31 install ${B}/fuzzing/fuzz_main ${D}${PTEST_PATH}/fuzzing
32}
33
34EXTRA_OECMAKE += "\
35 -DENABLE_CJSON_UTILS=On \
36 -DENABLE_CUSTOM_COMPILER_FLAGS=OFF \
37 -DBUILD_SHARED_AND_STATIC_LIBS=On \
38"
39
40BBCLASSEXTEND = "native nativesdk"