From a07f028b7ab561cf805b5080022e99ec862703ac Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Wed, 9 Oct 2024 23:01:01 -0700 Subject: jansson: add JSON_INTEGER_IS_LONG_LONG for cmake This macro is documented, so it should be consistent across different build systems. It's defined in autotools, but not cmake. Add it for cmake. Signed-off-by: Chen Qi Signed-off-by: Khem Raj (cherry picked from commit a3854f6893afb53d896394ddcc26568b25d04d91) Signed-off-by: Armin Kuster --- ...-back-JSON_INTEGER_IS_LONG_LONG-for-cmake.patch | 51 ++++++++++++++++++++++ meta-oe/recipes-extended/jansson/jansson_2.14.bb | 1 + 2 files changed, 52 insertions(+) create mode 100644 meta-oe/recipes-extended/jansson/jansson/0001-add-back-JSON_INTEGER_IS_LONG_LONG-for-cmake.patch diff --git a/meta-oe/recipes-extended/jansson/jansson/0001-add-back-JSON_INTEGER_IS_LONG_LONG-for-cmake.patch b/meta-oe/recipes-extended/jansson/jansson/0001-add-back-JSON_INTEGER_IS_LONG_LONG-for-cmake.patch new file mode 100644 index 0000000000..5298cfbefc --- /dev/null +++ b/meta-oe/recipes-extended/jansson/jansson/0001-add-back-JSON_INTEGER_IS_LONG_LONG-for-cmake.patch @@ -0,0 +1,51 @@ +From 521d37abc0ed1178a39298d06d80d8d0e2a43e28 Mon Sep 17 00:00:00 2001 +From: Chen Qi +Date: Tue, 10 Sep 2024 00:48:00 -0700 +Subject: [PATCH] add back JSON_INTEGER_IS_LONG_LONG for cmake + +For autotools, JSON_INTEGER_IS_LONG_LONG is defined, but for +cmake, it's not. This means such macro, which is also documented, +is not consistent across different build systems. This is not +good, so add it for cmake. + +This patch refers 8b975abca1055d40637c90b1dc4585af1d7df76c and is +part of it. So the upstream-status is marked as 'oe specific'. + +Upstream-Status: Inappropriate [OE Specific] + +Signed-off-by: Chen Qi +--- + CMakeLists.txt | 1 + + cmake/jansson_config.h.cmake | 4 +--- + 2 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 39b9ad3..0e95a94 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -193,6 +193,7 @@ endif () + # detect what to use for the 64 bit type. + # Note: I will prefer long long if I can get it, as that is what the automake system aimed for. + if (NOT DEFINED JSON_INT_T) ++ set (JSON_INTEGER_IS_LONG_LONG 1) + if (HAVE_LONG_LONG_INT AND (LONG_LONG_INT EQUAL 8)) + set (JSON_INT_T "long long") + elseif (HAVE_INT64_T) +diff --git a/cmake/jansson_config.h.cmake b/cmake/jansson_config.h.cmake +index 2f248cb..bec64da 100644 +--- a/cmake/jansson_config.h.cmake ++++ b/cmake/jansson_config.h.cmake +@@ -21,9 +21,7 @@ + #define JANSSON_USING_CMAKE + #endif + +-/* Note: when using cmake, JSON_INTEGER_IS_LONG_LONG is not defined nor used, +- * as we will also check for __int64 etc types. +- * (the definition was used in the automake system) */ ++#cmakedefine JSON_INTEGER_IS_LONG_LONG 1 + + /* Bring in the cmake-detected defines */ + #cmakedefine HAVE_STDINT_H 1 +-- +2.42.0 + diff --git a/meta-oe/recipes-extended/jansson/jansson_2.14.bb b/meta-oe/recipes-extended/jansson/jansson_2.14.bb index fb42509f36..9f5cdcf4c0 100644 --- a/meta-oe/recipes-extended/jansson/jansson_2.14.bb +++ b/meta-oe/recipes-extended/jansson/jansson_2.14.bb @@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=afd92c4cfc08f4896003251b878cc0bf" SRC_URI = "https://github.com/akheron/${BPN}/releases/download/v${PV}/${BP}.tar.bz2 \ file://0001-Fix-overwriting-linker-flags.patch \ file://0001-Honour-multilib-paths.patch \ + file://0001-add-back-JSON_INTEGER_IS_LONG_LONG-for-cmake.patch \ " SRC_URI[sha256sum] = "fba956f27c6ae56ce6dfd52fbf9d20254aad42821f74fa52f83957625294afb9" -- cgit v1.2.3-54-g00ecf