SHA256
11
0
forked from pool/snappy

29 Commits

Author SHA256 Message Date
c21dc75d3a Accepting request 1290696 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/1290696
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/snappy?expand=0&rev=15
2025-07-06 15:04:00 +00:00
a1bd0bb2c5 - update to 1.2.2
* We fixed a very old issue of data corruption when compressed
    size exceeds 4GB. This can happen when you compress data
    close to 4GB and it's incompressible, for example, random
    data.
 *  Started to use minimum CMake 3.10 because older ones are not
    planned to be supported.
- update to 1.2.1
  * We restored old functions/symbols after reports of ABI
    incompatibility apache/arrow#41058
- update to 1.2.0
  * Level API was added with level 2 support. Compresses 5-10%
    denser and decompresses 5-10% faster. The compression speed
    drop is about 20-30%
- add correct_testing_link.patch, taken from Debian
- adjust reenable-rtti.patch
- adjust use-system-test-libs.patch, following the patch from
  Debian

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/snappy?expand=0&rev=30
2025-07-04 13:49:53 +00:00
c46fceb437 Accepting request 1287813 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/1287813
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/snappy?expand=0&rev=14
2025-06-24 18:45:56 +00:00
ec2305811a Accepting request 1286910 from home:AndreasStieger:branches:devel:libraries:c_c++
- Fix build with googletest 1.17.0 by using C++17, boo#1244989

OBS-URL: https://build.opensuse.org/request/show/1286910
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/snappy?expand=0&rev=28
2025-06-23 05:51:27 +00:00
4de01910a1 Accepting request 1271999 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/1271999
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/snappy?expand=0&rev=13
2025-04-23 13:17:57 +00:00
ed4e35da9b - Update summary of the most prominently installed (sub)package.
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/snappy?expand=0&rev=26
2025-04-22 17:45:33 +00:00
cc0b05682f Accepting request 1256199 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/1256199
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/snappy?expand=0&rev=12
2025-03-28 08:36:20 +00:00
305f069a59 - Add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to fix FTBFS with cmake4
- Remove Group: declarations, no longer used

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/snappy?expand=0&rev=24
2025-03-26 12:26:41 +00:00
1d0350d0cd Accepting request 1161374 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/1161374
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/snappy?expand=0&rev=11
2024-03-25 20:06:14 +00:00
Danilo Spinella
9fc9daacc5 Accepting request 1161373 from home:dspinella:branches:devel:libraries:c_c++
- Fix build with GTest 1.14.0 by using C++14, bsc#1221872

OBS-URL: https://build.opensuse.org/request/show/1161373
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/snappy?expand=0&rev=22
2024-03-25 11:36:48 +00:00
68015f86f4 Accepting request 1124994 from devel:libraries:c_c++
- update to 1.1.10:
  * Performance improvements
  * Compilation fixes for various environments
- drop fix-always-inline.patch (obsolete)

  - This is a maintenance release with no changes to the actual

OBS-URL: https://build.opensuse.org/request/show/1124994
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/snappy?expand=0&rev=10
2023-11-13 21:15:42 +00:00
eef6e203d4 - update to 1.1.10:
* Performance improvements
  * Compilation fixes for various environments
- drop fix-always-inline.patch (obsolete)
  - This is a maintenance release with no changes to the actual

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/snappy?expand=0&rev=20
2023-11-10 13:57:31 +00:00
6372de1ce3 Accepting request 929633 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/929633
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/snappy?expand=0&rev=9
2021-11-06 17:15:40 +00:00
Danilo Spinella
da1721426d Accepting request 927746 from filesystems:ceph:master:upstream
Re-enable RTTI, to fix Ceph runtime failures (for details see https://tracker.ceph.com/issues/53060 and https://github.com/google/snappy/pull/144).  Note that we're already carrying a similar patch for leveldb, for the same reason.  If accepted, please pass this on to Factory.  Thank you!

OBS-URL: https://build.opensuse.org/request/show/927746
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/snappy?expand=0&rev=19
2021-11-05 10:53:06 +00:00
a96492af76 Accepting request 907347 from devel:libraries:c_c++
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/907347
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/snappy?expand=0&rev=8
2021-08-04 20:28:17 +00:00
Danilo Spinella
3bbb4b46cb Accepting request 906176 from home:dspinella:branches:devel:libraries:c_c++
- Update to 1.1.9:
  * Performance improvements
- Add fix-always-inline.patch
- Add use-system-test-libs.patch
- Add a hardcoded snappy.pc file

OBS-URL: https://build.opensuse.org/request/show/906176
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/snappy?expand=0&rev=18
2021-07-14 08:29:50 +00:00
da81a5af07 Accepting request 829564 from devel:libraries:c_c++
- update to 1.1.8:
  * Small performance improvements.
  * Removed snappy::string alias for std::string.
  * Improved CMake configuration.
- remove snappy-pcfile.patch (never went upstream)

OBS-URL: https://build.opensuse.org/request/show/829564
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/snappy?expand=0&rev=7
2020-08-28 19:14:31 +00:00
407c983dec - update to 1.1.8:
* Small performance improvements.
  * Removed snappy::string alias for std::string.
  * Improved CMake configuration.
- remove snappy-pcfile.patch (never went upstream)

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/snappy?expand=0&rev=16
2020-08-25 13:20:09 +00:00
620814e771 Accepting request 574330 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/574330
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/snappy?expand=0&rev=6
2018-02-12 09:10:25 +00:00
Tomáš Chvátal
9407e215eb Accepting request 574307 from home:jengelh:branches:devel:libraries:c_c++
- Better neutrality of from description. Quantify "Core i7".
  Trim description of SRPM and -devel as the user already has an
  idea what to look for.
- Fix RPM groups.

OBS-URL: https://build.opensuse.org/request/show/574307
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/snappy?expand=0&rev=14
2018-02-08 16:47:49 +00:00
Tomáš Chvátal
a810b6947b - Version update to 1.1.7:
* Aarch64 fixes
  * ppc speedups
  * PIE improvements
  * Switch to cmake build system
- Add patch snappy-pcfile.patch:
  * Pull 55 on upstream github, was dropped when moving to cmake
    of course we still need it
- Fix license install wrt bsc#1080040

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/snappy?expand=0&rev=13
2018-02-08 11:55:43 +00:00
Tomáš Chvátal
4e770deff0 Accepting request 488140 from home:TheBlackCat:branches:devel:libraries:c_c++
- Version bump to 1.1.4
- Use better download url.

OBS-URL: https://build.opensuse.org/request/show/488140
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/snappy?expand=0&rev=12
2017-04-18 10:57:37 +00:00
96685c18de Accepting request 319376 from devel:libraries:c_c++
- Version bump to 1.1.3:
  * See the NEWS file for full details
- Switch to distribution from github
- Remove upstreamed patch:
  * snappy-1.1.1-random-return.patch

- Add baselibs.conf: build snappy1-32bit, as needed by
  libqt5-qtwebengine-32bit.

- Update to version 1.1.2
  - This is a maintenance release with no changes to the actual 
    library source code.
    * Stop distributing benchmark data files that have unclear
      or unsuitable licensing.
    * Add support for padding chunks in the framing format.

OBS-URL: https://build.opensuse.org/request/show/319376
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/snappy?expand=0&rev=5
2015-08-21 05:35:20 +00:00
Tomáš Chvátal
f2113ff790 - Version bump to 1.1.3:
* See the NEWS file for full details
- Switch to distribution from github
- Remove upstreamed patch:
  * snappy-1.1.1-random-return.patch

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/snappy?expand=0&rev=10
2015-07-29 11:03:33 +00:00
85c6f49dc6 Accepting request 319250 from home:dimstar:Factory
- Add baselibs.conf: build snappy1-32bit, as needed by
  libqt5-qtwebengine-32bit.

OBS-URL: https://build.opensuse.org/request/show/319250
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/snappy?expand=0&rev=9
2015-07-29 10:05:15 +00:00
Ismail Dönmez
517065cd72 Accepting request 248455 from devel:languages:python3
1

OBS-URL: https://build.opensuse.org/request/show/248455
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/snappy?expand=0&rev=8
2014-09-11 10:14:18 +00:00
Stephan Kulow
aad36261f5 Accepting request 206979 from devel:libraries:c_c++
Update (forwarded request 206746 from posophe)

OBS-URL: https://build.opensuse.org/request/show/206979
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/snappy?expand=0&rev=3
2013-11-15 12:39:00 +00:00
a924899339 Accepting request 206746 from home:posophe:branches:devel:libraries:c_c++
Update

OBS-URL: https://build.opensuse.org/request/show/206746
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/snappy?expand=0&rev=6
2013-11-15 08:54:58 +00:00
Stephan Kulow
48e3b94d7d Accepting request 196062 from devel:libraries:c_c++
add snappy to Factory, see FATE in changes

OBS-URL: https://build.opensuse.org/request/show/196062
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/snappy?expand=0&rev=1
2013-09-05 21:26:03 +00:00
7 changed files with 123 additions and 124 deletions

BIN
1.1.10.tar.gz (Stored with Git LFS)

Binary file not shown.

View File

@@ -0,0 +1,28 @@
Description: add required libraries to link with
Just add those libraries to the linker.
Author: Laszlo Boszormenyi (GCS) <gcs@debian.org>
Forwarded: not-needed
Last-Update: 2021-12-04
---
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -350,7 +350,7 @@ if(SNAPPY_BUILD_TESTS)
PRIVATE
"snappy_unittest.cc"
)
- target_link_libraries(snappy_unittest snappy_test_support gmock_main gtest)
+ target_link_libraries(snappy_unittest snappy_test_support gmock_main gmock gtest pthread)
add_test(
NAME snappy_unittest
@@ -371,7 +371,7 @@ if(SNAPPY_BUILD_BENCHMARKS)
PRIVATE
"snappy_benchmark.cc"
)
- target_link_libraries(snappy_benchmark snappy_test_support benchmark_main)
+ target_link_libraries(snappy_benchmark snappy_test_support benchmark_main benchmark pthread)
# This project uses Google benchmark for benchmarking.
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE)

View File

@@ -2,24 +2,25 @@ Index: snappy-1.1.9/CMakeLists.txt
===================================================================
--- snappy-1.1.9.orig/CMakeLists.txt
+++ snappy-1.1.9/CMakeLists.txt
@@ -51,10 +51,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"
string(REGEX REPLACE "/EH[a-z]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHs-c-")
@@ -53,8 +53,8 @@
add_definitions(-D_HAS_EXCEPTIONS=0)
-
- # Disable RTTI.
# Disable RTTI.
- string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-")
else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ # string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-")
else(MSVC)
# Use -Wall for clang and gcc.
if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")
@@ -77,9 +73,6 @@ else(CMAKE_CXX_COMPILER_ID STREQUAL "MSV
string(REGEX REPLACE "-fexceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
@@ -83,8 +83,8 @@
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
- # Disable RTTI.
# Disable RTTI.
- string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ # string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
endif(MSVC)
# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make

3
snappy-1.2.2.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:90f74bc1fbf78a6c56b3c4a082a05103b3a56bb17bca1a27e052ea11723292dc
size 1108618

View File

@@ -1,3 +1,41 @@
-------------------------------------------------------------------
Sun Jun 29 11:18:27 UTC 2025 - Christoph G <foss@grueninger.de>
- update to 1.2.2
* We fixed a very old issue of data corruption when compressed
size exceeds 4GB. This can happen when you compress data
close to 4GB and it's incompressible, for example, random
data.
* Started to use minimum CMake 3.10 because older ones are not
planned to be supported.
- update to 1.2.1
* We restored old functions/symbols after reports of ABI
incompatibility apache/arrow#41058
- update to 1.2.0
* Level API was added with level 2 support. Compresses 5-10%
denser and decompresses 5-10% faster. The compression speed
drop is about 20-30%
- add correct_testing_link.patch, taken from Debian
- adjust reenable-rtti.patch
- adjust use-system-test-libs.patch, following the patch from
Debian
-------------------------------------------------------------------
Thu Jun 19 11:08:34 UTC 2025 - Andreas Stieger <andreas.stieger@gmx.de>
- Fix build with googletest 1.17.0 by using C++17, boo#1244989
-------------------------------------------------------------------
Thu Apr 17 12:41:48 UTC 2025 - Jan Engelhardt <jengelh@inai.de>
- Update summary of the most prominently installed (sub)package.
-------------------------------------------------------------------
Sat Mar 22 15:51:54 UTC 2025 - Shawn Dunn <sfalken@opensuse.org>
- Add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to fix FTBFS with cmake4
- Remove Group: declarations, no longer used
-------------------------------------------------------------------
Mon Mar 25 11:34:39 UTC 2024 - Danilo Spinella <danilo.spinella@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package snappy
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,22 +18,23 @@
%define libname libsnappy1
Name: snappy
Version: 1.1.10
Version: 1.2.2
Release: 0
Summary: A compressor/decompressor library favoring time
License: BSD-3-Clause
Group: Development/Libraries/C and C++
URL: https://github.com/google/snappy/
Source0: https://github.com/google/snappy/archive/%{version}.tar.gz
Source0: https://github.com/google/snappy/archive/%{version}.tar.gz#/snappy-%{version}.tar.gz
Source1: snappy.pc
Source99: baselibs.conf
Patch0: use-system-test-libs.patch
Patch2: reenable-rtti.patch
BuildRequires: cmake
Patch1: reenable-rtti.patch
Patch2: correct_testing_link.patch
BuildRequires: cmake >= 3.10
BuildRequires: gcc-c++
BuildRequires: lzo-devel
BuildRequires: pkgconfig
BuildRequires: pkgconfig(benchmark)
BuildRequires: pkgconfig(gmock)
BuildRequires: pkgconfig(gtest)
BuildRequires: pkgconfig(zlib)
@@ -43,8 +44,7 @@ compression, or compatibility with any other compression library; instead, it
aims for high speeds and reasonable compression.
%package -n %{libname}
Summary: Shared library from snappy
Group: System/Libraries
Summary: A compressor/decompressor library favoring time
%description -n %{libname}
Snappy is a compression/decompression library. It does not aim for maximum
@@ -60,7 +60,6 @@ This package holds the shared library of snappy.
%package devel
Summary: Development files for snappy
Group: Development/Libraries/C and C++
Requires: %{libname} = %{version}
%description devel
@@ -74,7 +73,10 @@ This package holds the development files for snappy.
%autosetup
%build
%cmake -DSNAPPY_USE_BUNDLED_GTEST=OFF -DSNAPPY_USE_BUNDLED_BENCHMARK_LIB=OFF -DCMAKE_CXX_STANDARD=14
%cmake \
-DSNAPPY_USE_BUNDLED_GTEST=OFF \
-DSNAPPY_USE_BUNDLED_BENCHMARK_LIB=OFF \
-DCMAKE_CXX_STANDARD=17
%make_build
%install
@@ -85,8 +87,7 @@ install -m 644 %{SOURCE1} %{buildroot}%{_libdir}/pkgconfig/%{name}.pc
%check
%ctest
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%ldconfig_scriptlets -n %{libname}
%files -n %{libname}
%license COPYING

View File

@@ -1,120 +1,51 @@
From 114df35e84ad95b6d5afbcf69aa85a14ff029000 Mon Sep 17 00:00:00 2001
From: Danilo Spinella <danilo.spinella@suse.com>
Date: Fri, 9 Jul 2021 16:57:35 +0200
Subject: [PATCH] Add a switch to use system gtest and benchmark
Upstream: https://github.com/google/snappy/pull/132
Description: googletest and gmock are packaged, use those
No need to add external (empty) project directories, will link with system
ones357.
Author: Laszlo Boszormenyi (GCS) <gcs@debian.org>
Forwarded: not-needed
Last-Update: 2024-05-01
Allow to use the gtest and benchmark libraries from the system.
Use pkg-config to check that the libraries are installed and to
add the correct cflags/link flags.
---
CMakeLists.txt | 66 ++++++++++++++++++++++++++++++++++++--------------
1 file changed, 48 insertions(+), 18 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 672561e..eb2a743 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -90,6 +90,14 @@ option(SNAPPY_BUILD_TESTS "Build Snappy's own tests." ON)
@@ -330,20 +330,20 @@
set(build_gmock ON)
option(SNAPPY_BUILD_BENCHMARKS "Build Snappy's benchmarks" ON)
+if(UNIX)
+ option(SNAPPY_USE_BUNDLED_GTEST "Build test using bundled googletest library" ON)
+ option(SNAPPY_USE_BUNDLED_BENCHMARK_LIB "Build benchmarks using bundled benchmark library" ON)
+else(UNIX)
+ set(SNAPPY_USE_BUNDLED_GTEST ON)
+ set(SNAPPY_USE_BUNDLED_BENCHMARK_LIB ON)
+endif(UNIX)
+
option(SNAPPY_FUZZING_BUILD "Build Snappy for fuzzing." OFF)
option(SNAPPY_REQUIRE_AVX "Target processors with AVX support." OFF)
@@ -284,29 +292,40 @@ endif(SNAPPY_BUILD_TESTS OR SNAPPY_BUILD_BENCHMARKS)
if(SNAPPY_BUILD_TESTS)
enable_testing()
- # Prevent overriding the parent project's compiler/linker settings on Windows.
- set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
- set(install_gtest OFF)
- set(install_gmock OFF)
- set(build_gmock ON)
-
- # This project is tested using GoogleTest.
# This project is tested using GoogleTest.
- add_subdirectory("third_party/googletest")
-
- # GoogleTest triggers a missing field initializers warning.
+ # 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_USE_BUNDLED_GTEST)
+ # Prevent overriding the parent project's compiler/linker settings on Windows.
+ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
+ set(install_gtest OFF)
+ set(install_gmock OFF)
+ set(build_gmock ON)
+
+ # This project is tested using 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)
+ else(SNAPPY_USE_BUNDLED_GTEST)
+ find_package(PkgConfig)
+ pkg_search_module(GTEST REQUIRED gtest_main)
+ endif(SNAPPY_USE_BUNDLED_GTEST)
-
- if(SNAPPY_HAVE_NO_IMPLICIT_INT_FLOAT_CONVERSION)
- set_property(TARGET gtest
- APPEND PROPERTY COMPILE_OPTIONS -Wno-implicit-int-float-conversion)
- endif(SNAPPY_HAVE_NO_IMPLICIT_INT_FLOAT_CONVERSION)
+ # 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_IMPLICIT_INT_FLOAT_CONVERSION)
+ # set_property(TARGET gtest
+ # APPEND PROPERTY COMPILE_OPTIONS -Wno-implicit-int-float-conversion)
+ # endif(SNAPPY_HAVE_NO_IMPLICIT_INT_FLOAT_CONVERSION)
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)
+ if(SNAPPY_USE_BUNDLED_GTEST)
+ target_link_libraries(snappy_unittest gmock_main gtest)
+ else(SNAPPY_USE_BUNDLED_BENCHMARK_LIB)
+ target_link_libraries(snappy_unittest ${GTEST_LDFLAGS})
+ target_compile_options(snappy_unittest PUBLIC ${GTEST_CFLAGS})
+ endif(SNAPPY_USE_BUNDLED_GTEST)
add_test(
NAME snappy_unittest
@@ -322,17 +341,28 @@ if(SNAPPY_BUILD_TESTS)
endif(SNAPPY_BUILD_TESTS)
if(SNAPPY_BUILD_BENCHMARKS)
+ if(NOT SNAPPY_USE_BUNDLED_BENCHMARK_LIB)
+ find_package(PkgConfig)
+ pkg_search_module(BENCHMARK REQUIRED benchmark)
+ endif(NOT SNAPPY_USE_BUNDLED_BENCHMARK_LIB)
+
add_executable(snappy_benchmark "")
target_sources(snappy_benchmark
PRIVATE
"snappy_benchmark.cc"
)
target_link_libraries(snappy_benchmark snappy_test_support benchmark_main)
+ if(NOT SNAPPY_USE_BUNDLED_BENCHMARK_LIB)
+ target_link_libraries(snappy_benchmark ${BENCHMARK_LDFLAGS})
+ target_compile_options(snappy_benchmark PUBLIC ${BENCHMARK_CFLAGS})
+ endif(NOT SNAPPY_USE_BUNDLED_BENCHMARK_LIB)
@@ -376,7 +376,7 @@
# 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")
+ if(SNAPPY_USE_BUNDLED_BENCHMARK_LIB)
+ add_subdirectory("third_party/benchmark")
+ endif(SNAPPY_USE_BUNDLED_BENCHMARK_LIB)
+ # add_subdirectory("third_party/benchmark")
endif(SNAPPY_BUILD_BENCHMARKS)
if(SNAPPY_FUZZING_BUILD)