Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 1 | DESCRIPTION = "Ultralightweight JSON parser in ANSI C" |
| 2 | HOMEPAGE = "https://github.com/DaveGamble/cJSON" |
| 3 | SECTION = "libs" |
| 4 | LICENSE = "MIT" |
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=218947f77e8cb8e2fa02918dc41c50d0" |
| 6 | |
| 7 | SRC_URI = "git://github.com/DaveGamble/cJSON.git;branch=master;protocol=https \ |
| 8 | file://run-ptest \ |
| 9 | " |
Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame^] | 10 | SRCREV = "87d8f0961a01bf09bef98ff89bae9fdec42181ee" |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 11 | |
| 12 | S = "${WORKDIR}/git" |
| 13 | |
| 14 | inherit cmake pkgconfig ptest |
| 15 | |
| 16 | RDEPENDS:${PN}-ptest += "cmake" |
| 17 | |
| 18 | do_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 | |
| 34 | EXTRA_OECMAKE += "\ |
| 35 | -DENABLE_CJSON_UTILS=On \ |
| 36 | -DENABLE_CUSTOM_COMPILER_FLAGS=OFF \ |
| 37 | -DBUILD_SHARED_AND_STATIC_LIBS=On \ |
| 38 | " |
| 39 | |
| 40 | BBCLASSEXTEND = "native nativesdk" |