mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 19:51:17 +00:00
rapidjson: additional cleanup
This commit is contained in:
parent
17bedbfc7c
commit
11ff4aefae
|
@ -6,7 +6,6 @@
|
|||
, graphviz
|
||||
, gtest
|
||||
, valgrind
|
||||
, buildTests ? !stdenv.hostPlatform.isStatic && !stdenv.isDarwin
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
|
@ -25,33 +24,48 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
hash = "sha256-kAGVJfDHEUV2qNR1LpnWq3XKBJy4hD3Swh6LX5shJpM=";
|
||||
};
|
||||
|
||||
patches = lib.optionals buildTests [
|
||||
./0000-unstable-use-nixpkgs-gtest.patch
|
||||
patches = [
|
||||
./use-nixpkgs-gtest.patch
|
||||
# https://github.com/Tencent/rapidjson/issues/2214
|
||||
./0001-unstable-valgrind-suppress-failures.patch
|
||||
./suppress-valgrind-failures.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
for f in doc/Doxyfile.*; do
|
||||
substituteInPlace $f \
|
||||
--replace-fail "WARN_IF_UNDOCUMENTED = YES" "WARN_IF_UNDOCUMENTED = NO"
|
||||
done
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
doxygen
|
||||
graphviz
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
gtest
|
||||
];
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
cmakeFlags = [
|
||||
(lib.cmakeBool "RAPIDJSON_BUILD_DOC" true)
|
||||
(lib.cmakeBool "RAPIDJSON_BUILD_TESTS" buildTests)
|
||||
(lib.cmakeBool "RAPIDJSON_BUILD_TESTS" true)
|
||||
(lib.cmakeBool "RAPIDJSON_BUILD_EXAMPLES" true)
|
||||
# gtest 1.13+ requires C++14 or later.
|
||||
(lib.cmakeBool "RAPIDJSON_BUILD_CXX11" false)
|
||||
(lib.cmakeBool "RAPIDJSON_BUILD_CXX17" true)
|
||||
] ++ lib.optionals buildTests [
|
||||
(lib.cmakeFeature "GTEST_INCLUDE_DIR" "${lib.getDev gtest}")
|
||||
# Prevent -march=native
|
||||
(lib.cmakeBool "RAPIDJSON_ENABLE_INSTRUMENTATION_OPT" false)
|
||||
# Disable -Werror by using build type specific flags, which are
|
||||
# added after general CMAKE_CXX_FLAGS.
|
||||
(lib.cmakeFeature "CMAKE_CXX_FLAGS_RELEASE" "-Wno-error")
|
||||
];
|
||||
|
||||
doCheck = buildTests;
|
||||
doCheck = !(stdenv.hostPlatform.isStatic || stdenv.isDarwin);
|
||||
|
||||
nativeCheckInputs = [
|
||||
gtest
|
||||
valgrind
|
||||
];
|
||||
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
--- a/test/unittest/CMakeLists.txt
|
||||
+++ b/test/unittest/CMakeLists.txt
|
||||
@@ -82,3 +81,0 @@
|
||||
- add_test(NAME valgrind_unittest
|
||||
- COMMAND valgrind --leak-check=full --error-exitcode=1 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest --gtest_filter=-SIMD.*
|
||||
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
|
||||
|
|
@ -1,28 +1,33 @@
|
|||
From b9206d360c19412d185263795d67c884feab281a Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Mayer <tobim@fastmail.fm>
|
||||
Date: Mon, 29 Jul 2024 07:26:50 +0200
|
||||
Subject: [PATCH] Use nixpkgs gtest
|
||||
|
||||
---
|
||||
test/CMakeLists.txt | 24 ++++++------------------
|
||||
1 file changed, 6 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
|
||||
index 11c1b04c..762eaa75 100644
|
||||
index 11c1b04c..3d02d475 100644
|
||||
--- a/test/CMakeLists.txt
|
||||
+++ b/test/CMakeLists.txt
|
||||
@@ -1,20 +1,14 @@
|
||||
@@ -1,20 +1,8 @@
|
||||
-find_package(GTestSrc)
|
||||
+find_package(GTest REQUIRED)
|
||||
+enable_testing()
|
||||
|
||||
-IF(GTESTSRC_FOUND)
|
||||
- enable_testing()
|
||||
+if (WIN32 AND (NOT CYGWIN) AND (NOT MINGW))
|
||||
+ set(gtest_disable_pthreads ON)
|
||||
+ set(gtest_force_shared_crt ON)
|
||||
+endif()
|
||||
+set(TEST_LIBRARIES GTest::gtest GTest::gtest_main)
|
||||
|
||||
- if (WIN32 AND (NOT CYGWIN) AND (NOT MINGW))
|
||||
- set(gtest_disable_pthreads ON)
|
||||
- set(gtest_force_shared_crt ON)
|
||||
- endif()
|
||||
+include_directories(SYSTEM ${GTEST_INCLUDE_DIR})
|
||||
|
||||
-
|
||||
- add_subdirectory(${GTEST_SOURCE_DIR} ${CMAKE_BINARY_DIR}/googletest)
|
||||
- include_directories(SYSTEM ${GTEST_INCLUDE_DIR})
|
||||
+set(TEST_LIBRARIES gtest gtest_main)
|
||||
|
||||
-
|
||||
- set(TEST_LIBRARIES gtest gtest_main)
|
||||
-
|
||||
- add_custom_target(tests ALL)
|
||||
|
@ -33,3 +38,6 @@ index 11c1b04c..762eaa75 100644
|
|||
+add_custom_target(tests ALL)
|
||||
+add_subdirectory(perftest)
|
||||
+add_subdirectory(unittest)
|
||||
--
|
||||
2.45.2
|
||||
|
Loading…
Reference in a new issue