blob: 350932388cf64554417781230c7fd190d45b95ec [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001SUMMARY = "JSON for modern C++"
2HOMEPAGE = "https://nlohmann.github.io/json/"
3SECTION = "libs"
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://LICENSE.MIT;md5=f969127d7b7ed0a8a63c2bbeae002588"
6
7CVE_PRODUCT = "json-for-modern-cpp"
8
Andrew Geissler5082cc72023-09-11 08:41:39 -04009SRC_URI = "git://github.com/nlohmann/json.git;branch=develop;protocol=https \
Patrick Williamsac13d5f2023-11-24 18:59:46 -060010 git://github.com/nlohmann/json_test_data.git;destsuffix=git/json_test_data;name=json-test-data;branch=master;protocol=https \
11 file://0001-custom-allocators-define-missing-rebind-type-3895.patch \
12 file://0001-tests-unit-iterators2-use-std-ranges-equals-for-rang.patch \
13 file://run-ptest \
14"
Patrick Williams92b42cb2022-09-03 06:53:57 -050015
16SRCREV = "bc889afb4c5bf1c0d8ee29ef35eaaf4c8bef8a5d"
Patrick Williamsac13d5f2023-11-24 18:59:46 -060017SRCREV_json-test-data = "a1375cea09d27cc1c4cadb8d00470375b421ac37"
18
Patrick Williamsda295312023-12-05 16:48:56 -060019SRCREV_FORMAT .= "_json-test-data"
Patrick Williams92b42cb2022-09-03 06:53:57 -050020
21S = "${WORKDIR}/git"
22
Patrick Williamsac13d5f2023-11-24 18:59:46 -060023inherit cmake ptest
Patrick Williams92b42cb2022-09-03 06:53:57 -050024
Patrick Williamsac13d5f2023-11-24 18:59:46 -060025EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DJSON_BuildTests=ON -DJSON_TestDataDirectory=${PTEST_PATH}/json_test_data', '-DJSON_BuildTests=OFF', d)}"
Patrick Williams92b42cb2022-09-03 06:53:57 -050026
27# nlohmann-json is a header only C++ library, so the main package will be empty.
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060028ALLOW_EMPTY:${PN} = "1"
Patrick Williams92b42cb2022-09-03 06:53:57 -050029RDEPENDS:${PN}-dev = ""
Patrick Williamsac13d5f2023-11-24 18:59:46 -060030RDEPENDS:${PN}-ptest = "perl"
Patrick Williams92b42cb2022-09-03 06:53:57 -050031
32BBCLASSEXTEND = "native nativesdk"
33
Patrick Williamsac13d5f2023-11-24 18:59:46 -060034
35do_install_ptest () {
36 install -d ${D}${PTEST_PATH}/tests
37 cp -r ${S}/json_test_data/ ${D}${PTEST_PATH}/
38 cp -r ${B}/tests/test-* ${D}${PTEST_PATH}/tests
Patrick Williamsda295312023-12-05 16:48:56 -060039 rm -rf ${D}${PTEST_PATH}/json_test_data/.git
Patrick Williamsac13d5f2023-11-24 18:59:46 -060040}
41
42
Patrick Williams92b42cb2022-09-03 06:53:57 -050043# other packages commonly reference the file directly as "json.hpp"
44# create symlink to allow this usage
45do_install:append() {
46 ln -s nlohmann/json.hpp ${D}${includedir}/json.hpp
47}