From 60fba5f9815dff9fc60df5163624b214b43bc755 Mon Sep 17 00:00:00 2001 From: "Laszlo Boszormenyi (GCS)" Date: Tue, 24 Mar 2020 18:20:00 +0000 Subject: [PATCH] fix linking with recent Google's C++ test framework Last-Update: 2018-10-11 Need to link with libgtest_main.a as well. Gbp-Pq: Name fix_google_test_link.patch --- src/Makefile.am | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index f5b93df..b5aea6b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -716,7 +716,7 @@ 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 -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, @@ -809,7 +809,7 @@ $(am_protobuf_test_OBJECTS): unittest_proto_middleman # 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 @@ -833,7 +833,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) @@ -847,7 +847,7 @@ $(am_protobuf_lite_test_OBJECTS): unittest_proto_middleman # 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) @@ -859,7 +859,7 @@ $(am_protobuf_lite_arena_test_OBJECTS): unittest_proto_middleman # 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 \ -- 2.30.2