[packages/rapidjson] another (adapted) upstream patch to fix build with gtest >= 1.13.0; rel 3
atler
atler at pld-linux.org
Sat May 11 15:26:00 CEST 2024
commit 3164191f447accc1c92fe8362fc47b4229ebe94a
Author: Jan Palus <atler at pld-linux.org>
Date: Sat May 11 14:42:04 2024 +0200
another (adapted) upstream patch to fix build with gtest >= 1.13.0; rel 3
git-fixes.patch | 43 +++++++++++++++++++++++++++++++++++++++++++
rapidjson.spec | 5 ++++-
2 files changed, 47 insertions(+), 1 deletion(-)
---
diff --git a/rapidjson.spec b/rapidjson.spec
index 34cfcd9..f4b68c9 100644
--- a/rapidjson.spec
+++ b/rapidjson.spec
@@ -2,7 +2,7 @@ Summary: Fast JSON parser and generator for C++
Summary(pl.UTF-8): Szybki parser i generator JSON-a dla C++
Name: rapidjson
Version: 1.1.0
-Release: 2
+Release: 3
License: MIT
Group: Libraries
#Source0Download: https://github.com/Tencent/rapidjson/releases
@@ -14,6 +14,7 @@ URL: http://miloyip.github.io/rapidjson
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: gtest-devel
+BuildRequires: libstdc++-devel >= 6:8
BuildRequires: rpmbuild(macros) >= 1.752
BuildRequires: valgrind
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -113,6 +114,8 @@ find . -type f -name 'CMakeLists.txt' -print0 | \
install -d build
cd build
%cmake .. \
+ -DRAPIDJSON_BUILD_CXX11:BOOL=OFF \
+ -DRAPIDJSON_BUILD_CXX17:BOOL=ON \
-DGTESTSRC_FOUND=TRUE \
-DGTEST_SOURCE_DIR=.
diff --git a/git-fixes.patch b/git-fixes.patch
index b8ce149..5b382f6 100644
--- a/git-fixes.patch
+++ b/git-fixes.patch
@@ -42,3 +42,46 @@ index b0f1f70be..19f5a6a5f 100644
};
//! Mark a character pointer as constant string
+From e336667b4a05b20d4c641def7130bf0c1fbd4cc2 Mon Sep 17 00:00:00 2001
+From: ylavic <ylavic.dev at gmail.com>
+Date: Mon, 29 Mar 2021 17:42:30 +0200
+Subject: [PATCH] Handle C++17 (and C++11 with MSVC) in CI.
+
+---
+ .travis.yml | 43 ++++++++++++++++++++++++++++---------------
+ CMakeLists.txt | 19 ++++++++++++++++++-
+ appveyor.yml | 32 +++++++++++++++++++++++++++++++-
+ 3 files changed, 77 insertions(+), 17 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3b9ac512b..dcca04f91 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -35,7 +35,8 @@ option(RAPIDJSON_BUILD_TESTS "Build rapidjson perftests and unittests." ON)
+ option(RAPIDJSON_BUILD_THIRDPARTY_GTEST
+ "Use gtest installation in `thirdparty/gtest` by default if available" OFF)
+
+-option(RAPIDJSON_BUILD_CXX11 "Build rapidjson with C++11 (gcc/clang)" ON)
++option(RAPIDJSON_BUILD_CXX11 "Build rapidjson with C++11" ON)
++option(RAPIDJSON_BUILD_CXX17 "Build rapidjson with C++17" OFF)
+
+ option(RAPIDJSON_BUILD_ASAN "Build rapidjson with address sanitizer (gcc/clang)" OFF)
+ option(RAPIDJSON_BUILD_UBSAN "Build rapidjson with undefined behavior sanitizer (gcc/clang)" OFF)
+@@ -77,6 +78,8 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ else()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ endif()
++ elseif (RAPIDJSON_BUILD_CXX17 AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0")
++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ endif()
+ if (RAPIDJSON_BUILD_ASAN)
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.0")
+@@ -105,6 +108,8 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra -Werror -Wno-missing-field-initializers")
+ if (RAPIDJSON_BUILD_CXX11)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++ elseif (RAPIDJSON_BUILD_CXX17 AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.0")
++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ endif()
+ if (RAPIDJSON_BUILD_ASAN)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rapidjson.git/commitdiff/3164191f447accc1c92fe8362fc47b4229ebe94a
More information about the pld-cvs-commit
mailing list