Package: protobuf / 3.6.1.3-2

disable_local_gmock.patch Patch series | download
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Description: use packaged Google Test and Google Mock libraries
 Link tests with the already compiled libraries.
Forwarded: not-needed
Author: Laszlo Boszormenyi (GCS) <gcs@debian.org>
Last-Update: 2018-05-29

---

--- a/Makefile.am
+++ b/Makefile.am
@@ -17,9 +17,9 @@ DIST_SUBDIRS = src conformance benchmark
 # want "make install" to recurse into gmock since we don't want to overwrite
 # the installed version of gmock if there is one.
 check-local:
-	@echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
-	@cd third_party/googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
-	@cd third_party/googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
+	@echo "NOT making lib/libgmock.a lib/libgmock_main.a in gmock"
+#	@cd third_party/googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
+#	@cd third_party/googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
 
 # We would like to clean gmock when "make clean" is invoked.  But we have to
 # be careful because clean-local is also invoked during "make distclean", but
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -718,10 +718,8 @@ GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_pa
 check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
                  no-warning-test $(GZCHECKPROGRAMS)
-protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la -lgtest \
+                      -lgmock -lgmock_main
 protobuf_test_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include \
                          -I$(GOOGLEMOCK_SRC_DIR)/include
 # Disable optimization for tests unless the user explicitly asked for it,
@@ -810,10 +808,7 @@ $(am_protobuf_test_OBJECTS): unittest_pr
 
 # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
 protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
-                      libprotoc.la                                   \
-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+                      libprotoc.la -lgtest -lgmock -lgmock_main
 protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \
                                          -I$(GOOGLETEST_SRC_DIR)/include \
                                          -DPROTOBUF_TEST_NO_DESCRIPTORS
@@ -837,9 +832,7 @@ COMMON_LITE_TEST_SOURCES =
 # full runtime and we want to make sure this test builds without full
 # runtime.
 protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la     \
-                           $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
-                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
-                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+                           -lgtest -lgmock -lgmock_main
 protobuf_lite_test_CPPFLAGS= -I$(GOOGLEMOCK_SRC_DIR)/include \
                              -I$(GOOGLETEST_SRC_DIR)/include
 protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
@@ -853,9 +846,7 @@ $(am_protobuf_lite_test_OBJECTS): unitte
 # gtest when building the test internally our memory sanitizer doesn't detect
 # memory leaks (don't know why).
 protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+                                 -lgtest -lgmock -lgmock_main
 protobuf_lite_arena_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include  \
                                     -I$(GOOGLETEST_SRC_DIR)/include
 protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
@@ -867,7 +858,7 @@ $(am_protobuf_lite_arena_test_OBJECTS):
 
 # Test plugin binary.
 test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
-                    $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la
+                    -lgtest
 test_plugin_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include
 test_plugin_SOURCES =                                          \
   google/protobuf/compiler/mock_code_generator.cc              \