File: fix_google_test_link.patch

package info (click to toggle)
protobuf 3.21.12-13
  • links: PTS
  • area: main
  • in suites: forky
  • size: 42,964 kB
  • sloc: cpp: 179,373; java: 88,098; objc: 60,661; ansic: 37,810; cs: 28,526; python: 22,516; php: 11,464; ruby: 6,127; sh: 3,635; makefile: 3,341; pascal: 2,352; xml: 2,317; javascript: 311; lisp: 87; awk: 17
file content (54 lines) | stat: -rw-r--r-- 2,862 bytes parent folder | download | duplicates (4)
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
Description: fix linking with recent Google's C++ test framework
 Need to link with libgtest_main.a as well.
Author: Laszlo Boszormenyi (GCS) <gcs@debian.org>
Last-Update: 2022-03-11

---

--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -725,7 +725,7 @@ check_PROGRAMS = protoc protobuf-test pr
                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
                  no-warning-test $(GZCHECKPROGRAMS)
 protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la -lgtest \
-                      -lgmock -lgmock_main
+                      -lgtest_main -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,
@@ -820,7 +820,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 -lgtest -lgmock -lgmock_main
+                      libprotoc.la -lgtest -lgtest_main -lgmock -lgmock_main
 protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \
                                          -I$(GOOGLETEST_SRC_DIR)/include \
                                          -DPROTOBUF_TEST_NO_DESCRIPTORS
@@ -845,7 +845,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     \
-                           -lgtest -lgmock -lgmock_main
+                           -lgtest -lgtest_main -lgmock -lgmock_main
 protobuf_lite_test_CPPFLAGS= -I$(GOOGLEMOCK_SRC_DIR)/include \
                              -I$(GOOGLETEST_SRC_DIR)/include
 protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
@@ -859,7 +859,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 \
-                                 -lgtest -lgmock -lgmock_main
+                                 -lgtest -lgtest_main -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)
@@ -871,7 +871,7 @@ $(am_protobuf_lite_arena_test_OBJECTS):
 
 # Test plugin binary.
 test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
-                    -lgtest
+                    -lgtest -lgtest_main
 test_plugin_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include
 test_plugin_SOURCES =                                          \
   google/protobuf/compiler/mock_code_generator.cc              \