summaryrefslogtreecommitdiff
blob: 8aa4c1eabd225e3e2d85c98c86cdee9ce8f4cceb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From 9c1283f6022647a6ea39c1388321d6029fcdf80c Mon Sep 17 00:00:00 2001
From: "Azamat H. Hackimov" <azamat.hackimov@gmail.com>
Date: Wed, 5 May 2021 21:19:22 +0300
Subject: [PATCH] Use external GTest framework

---
 CMakeLists.txt | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 672561e..fc830fe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -291,15 +291,8 @@ if(SNAPPY_BUILD_TESTS)
   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)
+  find_package(GTest REQUIRED)
+  include(GoogleTest)
 
   add_executable(snappy_unittest "")
   target_sources(snappy_unittest
-- 
2.26.3