summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorAndre McCurdy <armccurdy@gmail.com>2016-12-19 08:56:33 -0800
committerMartin Jansa <Martin.Jansa@gmail.com>2016-12-26 08:24:52 +0100
commit45de4a60c63a1e73a3a058c218398c116ef922fb (patch)
treea5a067e962a1ee799dc69460f55e87808861f0b6 /meta-oe
parenta2e1a14961b9fe9aede61fa91a29272bd70071f6 (diff)
downloadmeta-openembedded-45de4a60c63a1e73a3a058c218398c116ef922fb.tar.gz
rapidjson: add initial recipe
A fast JSON parser/generator for C++ with both SAX/DOM style API. Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-devtools/rapidjson/rapidjson/Fix-gcc-strict-overflow-warning.patch30
-rw-r--r--meta-oe/recipes-devtools/rapidjson/rapidjson/remove-march-native-from-CMAKE_CXX_FLAGS.patch33
-rw-r--r--meta-oe/recipes-devtools/rapidjson/rapidjson_1.0.2.bb24
3 files changed, 87 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/rapidjson/rapidjson/Fix-gcc-strict-overflow-warning.patch b/meta-oe/recipes-devtools/rapidjson/rapidjson/Fix-gcc-strict-overflow-warning.patch
new file mode 100644
index 000000000..6ce3933ce
--- /dev/null
+++ b/meta-oe/recipes-devtools/rapidjson/rapidjson/Fix-gcc-strict-overflow-warning.patch
@@ -0,0 +1,30 @@
1From f5560d9557ee48fb79810180ddfd3ec386e2a7b5 Mon Sep 17 00:00:00 2001
2From: Milo Yip <miloyip@gmail.com>
3Date: Wed, 2 Mar 2016 01:01:17 +0800
4Subject: [PATCH] Fix gcc strict-overflow warning
5
6Fix #566 #568
7
8Upstream-Status: Backport [Partial merge of upstream commit 928caf92e]
9
10Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
11---
12 include/rapidjson/internal/dtoa.h | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/include/rapidjson/internal/dtoa.h b/include/rapidjson/internal/dtoa.h
16index 2d8d2e4..15571e1 100644
17--- a/include/rapidjson/internal/dtoa.h
18+++ b/include/rapidjson/internal/dtoa.h
19@@ -148,7 +148,7 @@ inline char* WriteExponent(int K, char* buffer) {
20 inline char* Prettify(char* buffer, int length, int k) {
21 const int kk = length + k; // 10^(kk-1) <= v < 10^kk
22
23- if (length <= kk && kk <= 21) {
24+ if (0 <= k && kk <= 21) {
25 // 1234e7 -> 12340000000
26 for (int i = length; i < kk; i++)
27 buffer[i] = '0';
28--
291.9.1
30
diff --git a/meta-oe/recipes-devtools/rapidjson/rapidjson/remove-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 000000000..17164283c
--- /dev/null
+++ b/meta-oe/recipes-devtools/rapidjson/rapidjson/remove-march-native-from-CMAKE_CXX_FLAGS.patch
@@ -0,0 +1,33 @@
1From 827155e5e659b2a5065b00d701bc59b57feab2bf Mon Sep 17 00:00:00 2001
2From: Andre McCurdy <armccurdy@gmail.com>
3Date: Mon, 19 Dec 2016 01:37:11 -0800
4Subject: [PATCH] remove -march=native from CMAKE_CXX_FLAGS
5
6Not appropriate when cross compiling.
7
8Upstream-Status: Inappropriate [configuration]
9
10Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
11---
12 CMakeLists.txt | 4 ++--
13 1 file changed, 2 insertions(+), 2 deletions(-)
14
15diff --git a/CMakeLists.txt b/CMakeLists.txt
16index 68139ba..cae7c9b 100644
17--- a/CMakeLists.txt
18+++ b/CMakeLists.txt
19@@ -26,9 +26,9 @@ if(RAPIDJSON_HAS_STDSTRING)
20 endif()
21
22 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
23- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra")
24+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
25 elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
26- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra")
27+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
28 elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
29 add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
30 endif()
31--
321.9.1
33
diff --git a/meta-oe/recipes-devtools/rapidjson/rapidjson_1.0.2.bb b/meta-oe/recipes-devtools/rapidjson/rapidjson_1.0.2.bb
new file mode 100644
index 000000000..1a9abc8bc
--- /dev/null
+++ b/meta-oe/recipes-devtools/rapidjson/rapidjson_1.0.2.bb
@@ -0,0 +1,24 @@
1SUMMARY = "A fast JSON parser/generator for C++ with both SAX/DOM style API"
2HOMEPAGE = "http://rapidjson.org/"
3SECTION = "libs"
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://license.txt;md5=cff54e417a17b4b77465198254970cd2"
6
7SRC_URI = "git://github.com/miloyip/rapidjson.git;nobranch=1 \
8 file://remove-march-native-from-CMAKE_CXX_FLAGS.patch \
9 file://Fix-gcc-strict-overflow-warning.patch \
10"
11
12SRCREV = "3d5848a7cd3367c5cb451c6493165b7745948308"
13
14S = "${WORKDIR}/git"
15
16inherit cmake
17
18EXTRA_OECMAKE += "-DRAPIDJSON_BUILD_DOC=OFF"
19
20# RapidJSON is a header-only C++ library, so the main package will be empty.
21
22FILES_${PN}-dev += "${libdir}/cmake"
23
24BBCLASSEXTEND = "native nativesdk"