Skip to content

Commit 0ee636b

Browse files
authored
Remove local googletest submodule and link with system gtest (sonic-net#245)
* Remove local googletest * Link with system gtest * Fix Makefile.am
1 parent b56ffba commit 0ee636b

7 files changed

+3
-61
lines changed

.gitmodules

-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "googletest"]
2-
path = googletest
3-
url = https://github.com/google/googletest.git

Makefile.am

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
SUBDIRS = common pyext
1+
SUBDIRS = common pyext tests
22

33
ACLOCAL_AMFLAGS = -I m4
4-
5-
if GTEST
6-
SUBDIRS += tests
7-
endif

ThirdPartyLicenses.txt

-31
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,3 @@ reserves all other rights not expressly granted, whether by implication, estoppe
2929
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3030
* SOFTWARE.
3131
*/
32-
2. gtest/gtest.h imported from https://code.google.com/p/googletest/
33-
34-
/* Copyright 2008, Google Inc.
35-
* All rights reserved.
36-
*
37-
* Redistribution and use in source and binary forms, with or without
38-
* modification, are permitted provided that the following conditions are
39-
* met:
40-
*
41-
* * Redistributions of source code must retain the above copyright
42-
* notice, this list of conditions and the following disclaimer.
43-
* * Redistributions in binary form must reproduce the above
44-
* copyright notice, this list of conditions and the following disclaimer
45-
* in the documentation and/or other materials provided with the
46-
* distribution.
47-
* * Neither the name of Google Inc. nor the names of its
48-
* contributors may be used to endorse or promote products derived from
49-
* this software without specific prior written permission.
50-
*
51-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
52-
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
53-
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
54-
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
55-
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
56-
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
57-
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
58-
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
59-
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
60-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
61-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
62-
*/

configure.ac

-9
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ AC_ARG_ENABLE(debug,
2929
esac],[debug=false])
3030
AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
3131

32-
AC_ARG_ENABLE(gtest,
33-
[ --enable-gtest Compile with googletest flags],
34-
[case "${enableval}" in
35-
yes) gtest=true ;;
36-
no) gtest=false ;;
37-
*) AC_MSG_ERROR(bad value ${enableval} for --enable-gtest) ;;
38-
esac],[gtest=false])
39-
AM_CONDITIONAL(GTEST, test x$gtest = xtrue)
40-
4132
AC_PATH_PROG(SWIG, [swig3.0])
4233

4334
CFLAGS_COMMON=""

debian/rules

-8
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,12 @@ include /usr/share/dpkg/default.mk
2626
#override_dh_auto_configure:
2727
# dh_auto_configure -- \
2828
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
29-
override_dh_auto_configure:
30-
bash -c 'mkdir -p googletest/build && cd $$_ && cmake ..'
31-
dh_auto_configure -- --enable-gtest
32-
33-
override_dh_auto_build:
34-
cd googletest/build && cmake --build .; cd -
35-
dh_auto_build
3629

3730
override_dh_auto_install:
3831
dh_auto_install
3932

4033
override_dh_clean:
4134
dh_clean
42-
rm -rf googletest/build
4335
rm -f pyext/swsscommon.py pyext/swsscommon_wrap.cpp
4436

4537
override_dh_strip:

googletest

-1
This file was deleted.

tests/Makefile.am

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ else
88
DBGFLAGS = -g -DNDEBUG
99
endif
1010

11-
CFLAGS_GTEST = -I $(top_srcdir)/googletest/googletest/include
12-
LDADD_GTEST = $(top_srcdir)/googletest/build/googlemock/gtest/libgtest_main.a \
13-
$(top_srcdir)/googletest/build/googlemock/gtest/libgtest.a
11+
CFLAGS_GTEST =
12+
LDADD_GTEST = -L/usr/src/gtest -lgtest -lgtest_main
1413

1514
tests_SOURCES = redis_ut.cpp \
1615
redis_piped_ut.cpp \
@@ -31,4 +30,3 @@ tests_SOURCES = redis_ut.cpp \
3130
tests_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(LIBNL_CFLAGS)
3231
tests_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(LIBNL_CFLAGS)
3332
tests_LDADD = $(LDADD_GTEST) -lpthread -L$(top_srcdir)/common -lswsscommon $(LIBNL_LIBS)
34-

0 commit comments

Comments
 (0)