Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
4a7a60b2fd
!19 Build with C++14 instead of C++11; gtest 1.13.0 requires it
From: @zhoupengcheng11 
Reviewed-by: @lvying6 
Signed-off-by: @lvying6
2024-01-12 02:20:30 +00:00
zhoupengcheng
2b6d20975f Build with C++14 instead of C++11; gtest 1.13.0 requires it 2024-01-12 09:51:23 +08:00
openeuler-ci-bot
a0e3209633
!18 update to 1.1.10
From: @dillon_chen 
Reviewed-by: @overweight 
Signed-off-by: @overweight
2023-07-06 01:06:18 +00:00
dillon_chen
4e4326b706 update to 1.1.10 2023-07-03 18:43:15 +08:00
openeuler-ci-bot
8cc1ee3424
!14 add option to enable rtti set default tocurrent
From: @wangzengliang1 
Reviewed-by: @xiezhipeng1 
Signed-off-by: @xiezhipeng1
2022-06-22 03:16:42 +00:00
wangzengliang
219f0c8b87 add option to enable rtti set default to current 2022-06-22 10:52:02 +08:00
openeuler-ci-bot
c6b865fdf8 !11 update version to 1.1.9
Merge pull request !11 from xinyingchao/master
2021-12-27 10:07:55 +00:00
renmingshuai
f6343715d1 update version to 1.1.9 2021-12-24 16:24:18 +08:00
openeuler-ci-bot
da173a973e !9 add testcases and delete unnecessary test code for snappy
From: @hanxinke
Reviewed-by: @licihua
Signed-off-by: @licihua
2021-12-02 13:37:02 +00:00
hanxinke
29a0534e43 add testcases and delete unnecessary test code for snappy 2021-12-02 07:28:34 -05:00
6 changed files with 167 additions and 17 deletions

View File

@ -0,0 +1,71 @@
From 07d1ae496bea8280f4cec08df5745845f7956365 Mon Sep 17 00:00:00 2001
From: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
Date: Wed, 6 Apr 2022 10:04:21 -0700
Subject: [PATCH] snappy: Autospec creation for version 1.1.9
This patch addresses an issue with Ceph
https://tracker.ceph.com/issues/53060. There have been multiple patches
to upstream snappy, but they have all been rejected and the reasoning
has always been that snappy would like to be consistent in their build
flags with chrome as mentioned at
https://github.com/google/snappy/pull/144#issuecomment-968371042
add-option-to-enable-rtti-set-default-to-current-ben.patch
---
CMakeLists.txt | 14 ++++++++++----
snappy-stubs-internal.h | 2 +-
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 672561e..cafdc59 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,8 +53,10 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_definitions(-D_HAS_EXCEPTIONS=0)
# Disable RTTI.
- string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-")
+ if(NOT SNAPPY_ENABLE_RTTI)
+ string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-")
+ endif(SNAPPY_ENABLE_RTTI)
else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# Use -Wall for clang and gcc.
if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")
@@ -78,8 +80,10 @@ else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
# Disable RTTI.
- string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
+ if(NOT SNAPPY_ENABLE_RTTI)
+ string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
+ endif(SNAPPY_ENABLE_RTTI)
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make
@@ -98,6 +102,8 @@ option(SNAPPY_REQUIRE_AVX2 "Target processors with AVX2 support." OFF)
option(SNAPPY_INSTALL "Install Snappy's header and library" ON)
+option(SNAPPY_ENABLE_RTTI "Enable RTTI for Snappy's library" OFF)
+
include(TestBigEndian)
test_big_endian(SNAPPY_IS_BIG_ENDIAN)
diff --git a/snappy-stubs-internal.h b/snappy-stubs-internal.h
index c2a838f..5bf7870 100644
--- a/snappy-stubs-internal.h
+++ b/snappy-stubs-internal.h
@@ -100,7 +100,7 @@
// Inlining hints.
#if HAVE_ATTRIBUTE_ALWAYS_INLINE
-#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline))
+#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE
#else
#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE
#endif // HAVE_ATTRIBUTE_ALWAYS_INLINE
--
2.24.4

View File

@ -0,0 +1,70 @@
From 14ccda0d6c228999c8d982a84562432cd7465743 Mon Sep 17 00:00:00 2001
From: hanxinke <hanxinke@huawei.com>
Date: Tue, 7 Dec 2021 15:34:34 +0800
Subject: [PATCH] remove dependency on google benchmark and gmock
Signed-off-by: hanxinke <hanxinke@huawei.com>
---
CMakeLists.txt | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 672561e..3127d9b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -88,7 +88,7 @@ option(BUILD_SHARED_LIBS "Build shared libraries(DLLs)." OFF)
option(SNAPPY_BUILD_TESTS "Build Snappy's own tests." ON)
-option(SNAPPY_BUILD_BENCHMARKS "Build Snappy's benchmarks" ON)
+option(SNAPPY_BUILD_BENCHMARKS "Build Snappy's benchmarks" OFF)
option(SNAPPY_FUZZING_BUILD "Build Snappy for fuzzing." OFF)
@@ -288,25 +288,25 @@ if(SNAPPY_BUILD_TESTS)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
set(install_gtest OFF)
set(install_gmock OFF)
- set(build_gmock ON)
+ set(build_gmock OFF)
# This project is tested using GoogleTest.
- add_subdirectory("third_party/googletest")
+ # add_subdirectory("third_party/googletest")
# GoogleTest triggers a missing field initializers warning.
- if(SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS)
- set_property(TARGET gtest
- APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers)
- set_property(TARGET gmock
- APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers)
- endif(SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS)
+ # if(SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS)
+ # set_property(TARGET gtest
+ # APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers)
+ # set_property(TARGET gmock
+ # APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers)
+ # endif(SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS)
add_executable(snappy_unittest "")
target_sources(snappy_unittest
PRIVATE
"snappy_unittest.cc"
)
- target_link_libraries(snappy_unittest snappy_test_support gmock_main gtest)
+ target_link_libraries(snappy_unittest snappy_test_support gtest_main gtest)
add_test(
NAME snappy_unittest
@@ -332,7 +332,7 @@ if(SNAPPY_BUILD_BENCHMARKS)
# This project uses Google benchmark for benchmarking.
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
set(BENCHMARK_ENABLE_EXCEPTIONS OFF CACHE BOOL "" FORCE)
- add_subdirectory("third_party/benchmark")
+ # add_subdirectory("third_party/benchmark")
endif(SNAPPY_BUILD_BENCHMARKS)
if(SNAPPY_FUZZING_BUILD)
--
1.8.3.1

BIN
snappy-1.1.10.tar.gz Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,12 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -212,7 +212,7 @@
"snappy-test.cc"
)
target_compile_definitions(snappy_unittest PRIVATE -DHAVE_CONFIG_H)
- target_link_libraries(snappy_unittest snappy ${GFLAGS_LIBRARIES})
+ target_link_libraries(snappy_unittest snappy ${GTEST_LIBRARIES} ${GFLAGS_LIBRARIES})
if(HAVE_LIBZ)
target_link_libraries(snappy_unittest z)

View File

@ -1,15 +1,16 @@
Name: snappy
Version: 1.1.8
Release: 1
Version: 1.1.10
Release: 2
Summary: A fast compressor/decompressor
License: BSD
URL: https://github.com/google/snappy
Source0: https://github.com/google/snappy/archive/%{version}/%{name}-%{version}.tar.gz
Source1: snappy.pc
Patch0: snappy-gtest.patch
Patch0: remove-dependency-on-google-benchmark-and-gmock.patch
Patch2: add-option-to-enable-rtti-set-default-to-current-ben.patch
BuildRequires: gcc-c++ automake autoconf gtest-devel cmake
BuildRequires: gcc-c++ make gtest-devel cmake
%description
Snappy is a compression/decompression library. It does not aim for maximum compression,
@ -31,7 +32,7 @@ This package is the development files for snappy.
%autosetup -n %{name}-%{version} -p1
%build
%cmake
%cmake -DSNAPPY_ENABLE_RTTI=ON -DCMAKE_CXX_STANDARD=14
%make_build
%install
@ -68,6 +69,26 @@ make test
%doc NEWS README.md
%changelog
* Fri Jan 12 2024 zhoupengcheng<zhoupengcheng11@huawei.com> -1.1.10-2
- Build with C++14 instead of C++11; gtest 1.13.0 requires it
* Mon Jul 3 2023 dillon chen<dillon.chen@gmail.com> -1.1.10-1
- update version to 1.1.10
- Removed patch1(inline.patch) as it's no longer required.
- repatch patch2(snappy-stubs-internal.h)
* Wed Jun 22 2022 wangzengliang<wangzengliang1@huawei.com> - 1.1.9-2
- DESC: add option to enable rtti set default to current
* Fri Dec 24 2021 yuanxin<yuanxin24@huawei.com> - 1.1.9-1
- update version to 1.1.9
* Thu Dec 2 2021 hanxinke<hanxinke@huawei.com> - 1.1.8-2
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: add testcases and delete unnecessary test code for snappy
* Fri Jul 17 2020 shixuantong <shixuantong> - 1.1.8-1
- Type:NA
- ID:NA