Skip to contentSkip to conversation

rapidjson: add initial recipe

PATCH In review Andre McCurdy 2 participants 2 messages Jan 13, 2017 – Jan 14, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 rapidjson: add initial recipe

A fast JSON parser/generator for C++ with both SAX/DOM style API.

---
 .../Fix-gcc-strict-overflow-warning.patch          | 30 ++++++++++++++++++++
 .../remove-march-native-from-CMAKE_CXX_FLAGS.patch | 33 ++++++++++++++++++++++
 .../recipes-devtools/rapidjson/rapidjson_1.0.2.bb  | 24 ++++++++++++++++
 3 files changed, 87 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/rapidjson/rapidjson/Fix-gcc-strict-overflow-warning.patch
 create mode 100644 meta-oe/recipes-devtools/rapidjson/rapidjson/remove-march-native-from-CMAKE_CXX_FLAGS.patch
 create mode 100644 meta-oe/recipes-devtools/rapidjson/rapidjson_1.0.2.bb
meta-oe/recipes-devtools/rapidjson/rapidjson/Fix-gcc-strict-overflow-warning.patch new file +30 -0
new file mode 100644
index 0000000..6ce3933
@@ -0,0 +1,30 @@
+From f5560d9557ee48fb79810180ddfd3ec386e2a7b5 Mon Sep 17 00:00:00 2001
+From: Milo Yip <[email protected]>
+Date: Wed, 2 Mar 2016 01:01:17 +0800
+Subject: [PATCH] Fix gcc strict-overflow warning
+
+Fix #566 #568
+
+Upstream-Status: Backport [Partial merge of upstream commit 928caf92e]
+
+Signed-off-by: Andre McCurdy <[email protected]>
+---
+ include/rapidjson/internal/dtoa.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/rapidjson/internal/dtoa.h b/include/rapidjson/internal/dtoa.h
+index 2d8d2e4..15571e1 100644
+--- a/include/rapidjson/internal/dtoa.h
++++ b/include/rapidjson/internal/dtoa.h
+@@ -148,7 +148,7 @@ inline char* WriteExponent(int K, char* buffer) {
+ inline char* Prettify(char* buffer, int length, int k) {
+     const int kk = length + k;  // 10^(kk-1) <= v < 10^kk
+ 
+-    if (length <= kk && kk <= 21) {
++    if (0 <= k && kk <= 21) {
+         // 1234e7 -> 12340000000
+         for (int i = length; i < kk; i++)
+             buffer[i] = '0';
+-- 
+1.9.1
+
meta-oe/recipes-devtools/rapidjson/rapidjson/remove-march-native-from-CMAKE_CXX_FLAGS.patch new file +33 -0
new file mode 100644
index 0000000..1716428
@@ -0,0 +1,33 @@
+From 827155e5e659b2a5065b00d701bc59b57feab2bf Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <[email protected]>
+Date: Mon, 19 Dec 2016 01:37:11 -0800
+Subject: [PATCH] remove -march=native from CMAKE_CXX_FLAGS
+
+Not appropriate when cross compiling.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Andre McCurdy <[email protected]>
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 68139ba..cae7c9b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -26,9 +26,9 @@ if(RAPIDJSON_HAS_STDSTRING)
+ endif()
+ 
+ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra")
++    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
+ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra")
++    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
+ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+     add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
+ endif()
+-- 
+1.9.1
+
meta-oe/recipes-devtools/rapidjson/rapidjson_1.0.2.bb new file +24 -0
new file mode 100644
index 0000000..dd6b896
@@ -0,0 +1,24 @@
+SUMMARY = "A fast JSON parser/generator for C++ with both SAX/DOM style API"
+HOMEPAGE = "http://rapidjson.org/"
+SECTION = "libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://license.txt;md5=cff54e417a17b4b77465198254970cd2"
+
+SRC_URI = "git://github.com/miloyip/rapidjson.git;nobranch=1 \
+           file://remove-march-native-from-CMAKE_CXX_FLAGS.patch \
+           file://Fix-gcc-strict-overflow-warning.patch \
+"
+
+SRCREV = "3d5848a7cd3367c5cb451c6493165b7745948308"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE += "-DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_TESTS=OFF"
+
+# RapidJSON is a header-only C++ library, so the main package will be empty.
+
+FILES_${PN}-dev += "${libdir}/cmake"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
1.9.1
#1 lore raw

It was already merged, so please resend just the EXTRA_OECMAKE part.

Quoted 141 lines · Andre McCurdy

A fast JSON parser/generator for C++ with both SAX/DOM style API.

---
 .../Fix-gcc-strict-overflow-warning.patch          | 30
++++++++++++++++++++
 .../remove-march-native-from-CMAKE_CXX_FLAGS.patch | 33
++++++++++++++++++++++
 .../recipes-devtools/rapidjson/rapidjson_1.0.2.bb  | 24 ++++++++++++++++
 3 files changed, 87 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/rapidjson/rapidjson/Fix-gcc-
strict-overflow-warning.patch
 create mode 100644 meta-oe/recipes-devtools/rapidjson/rapidjson/remove-
march-native-from-CMAKE_CXX_FLAGS.patch
 create mode 100644 meta-oe/recipes-devtools/rapidjson/rapidjson_1.0.2.bb
meta-oe/recipes-devtools/rapidjson/rapidjson/Fix-gcc- renamed from meta-oe/recipes-devtools/rapidjson/rapidjson/Fix-gcc-strict-overflow-warning.patch +0 -0

strict-overflow-warning.patch
new file mode 100644
index 0000000..6ce3933

meta-oe/recipes-devtools/rapidjson/rapidjson/Fix-gcc- new file +0 -0

strict-overflow-warning.patch

meta-oe/recipes-devtools/rapidjson/rapidjson/Fix-gcc- new file +15 -0
@@ -0,0 +1,30 @@
+From f5560d9557ee48fb79810180ddfd3ec386e2a7b5 Mon Sep 17 00:00:00 2001
+From: Milo Yip <[email protected]>
+Date: Wed, 2 Mar 2016 01:01:17 +0800
+Subject: [PATCH] Fix gcc strict-overflow warning
+
+Fix #566 #568
+
+Upstream-Status: Backport [Partial merge of upstream commit 928caf92e]
+
+Signed-off-by: Andre McCurdy <[email protected]>
+---
+ include/rapidjson/internal/dtoa.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/rapidjson/internal/dtoa.h

b/include/rapidjson/internal/dtoa.h

meta-oe/recipes-devtools/rapidjson/rapidjson/Fix-gcc- new file +15 -0
+index 2d8d2e4..15571e1 100644
+--- a/include/rapidjson/internal/dtoa.h
++++ b/include/rapidjson/internal/dtoa.h
+@@ -148,7 +148,7 @@ inline char* WriteExponent(int K, char* buffer) {
+ inline char* Prettify(char* buffer, int length, int k) {
+     const int kk = length + k;  // 10^(kk-1) <= v < 10^kk
+
+-    if (length <= kk && kk <= 21) {
++    if (0 <= k && kk <= 21) {
+         // 1234e7 -> 12340000000
+         for (int i = length; i < kk; i++)
+             buffer[i] = '0';
+--
+1.9.1
+
(quoted diff) +0 -0

march-native-from-CMAKE_CXX_FLAGS.patch b/meta-oe/recipes-devtools/ rapidjson/rapidjson/remove-march-native-from-CMAKE_CXX_FLAGS.patch new file mode 100644
index 0000000..1716428

meta-oe/recipes-devtools/rapidjson/rapidjson/remove- new file +0 -0

march-native-from-CMAKE_CXX_FLAGS.patch

meta-oe/recipes-devtools/rapidjson/rapidjson/remove- new file +33 -0
@@ -0,0 +1,33 @@
+From 827155e5e659b2a5065b00d701bc59b57feab2bf Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <[email protected]>
+Date: Mon, 19 Dec 2016 01:37:11 -0800
+Subject: [PATCH] remove -march=native from CMAKE_CXX_FLAGS
+
+Not appropriate when cross compiling.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Andre McCurdy <[email protected]>
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 68139ba..cae7c9b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -26,9 +26,9 @@ if(RAPIDJSON_HAS_STDSTRING)
+ endif()
+
+ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra")
++    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
+ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra")
++    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
+ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+     add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
+ endif()
+--
+1.9.1
+
meta-oe/recipes-devtools/rapidjson/rapidjson_1.0.2.bb new file +1 -0
new file mode 100644
index 0000000..dd6b896
@@ -0,0 +1,24 @@
+SUMMARY = "A fast JSON parser/generator for C++ with both SAX/DOM style

API"

meta-oe/recipes-devtools/rapidjson/rapidjson_1.0.2.bb new file +4 -0
+HOMEPAGE = "http://rapidjson.org/"
+SECTION = "libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://license.txt;md5=cff54e417a17b4b77465198254970c

d2"

meta-oe/recipes-devtools/rapidjson/rapidjson_1.0.2.bb new file +15 -0
+
+SRC_URI = "git://github.com/miloyip/rapidjson.git;nobranch=1 \
+           file://remove-march-native-from-CMAKE_CXX_FLAGS.patch \
+           file://Fix-gcc-strict-overflow-warning.patch \
+"
+
+SRCREV = "3d5848a7cd3367c5cb451c6493165b7745948308"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE += "-DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_TESTS=OFF"
+
+# RapidJSON is a header-only C++ library, so the main package will be

empty.

meta-oe/recipes-devtools/rapidjson/rapidjson_1.0.2.bb new file +4 -1
+
+FILES_${PN}-dev += "${libdir}/cmake"
+
+BBCLASSEXTEND = "native nativesdk"
--

1.9.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel