Skip to content

Commit

Permalink
Update gtest Makefile setup
Browse files Browse the repository at this point in the history
Summary: As title. This should fix the incomplete transition to a separate builddir.

Differential Revision: D54360694
  • Loading branch information
agampe authored and facebook-github-bot committed Feb 29, 2024
1 parent b311b11 commit 1a91433
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 29 deletions.
26 changes: 15 additions & 11 deletions test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,29 @@ SUBDIRS = . integ unit

check_LTLIBRARIES = libgtest.la libgtest_main.la libgmock_main.la

libgtest_la_CPPFLAGS = -I$(srcdir)/googletest-release-1.10.0/googletest -I$(srcdir)/googletest-release-1.10.0/googletest/include
libgtest_la_SOURCES = googletest-release-1.10.0/googletest/src/gtest-all.cc
# Note: Use at least 1.10 as we need googlemock, too.
GOOGLETEST_MIN_VERSION = 1.10.0

libgtest_main_la_CPPFLAGS = -I$(srcdir)/googletest-release-1.10.0/googletest -I$(srcdir)/googletest-release-1.10.0/googletest/include
libgtest_main_la_SOURCES = googletest-release-1.10.0/googletest/src/gtest_main.cc
libgtest_la_CPPFLAGS = -I$(srcdir)/googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest -I$(srcdir)/googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest/include
libgtest_la_SOURCES = googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest/src/gtest-all.cc

libgtest_main_la_CPPFLAGS = -I$(srcdir)/googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest -I$(srcdir)/googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest/include
libgtest_main_la_SOURCES = googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest/src/gtest_main.cc
libgtest_main_la_LIBADD = libgtest.la

libgmock_main_la_CPPFLAGS = -I$(srcdir)/googletest-release-1.10.0/googlemock -I$(srcdir)/googletest-release-1.10.0/googlemock/include -I$(srcdir)/googletest-release-1.10.0/googletest/include
libgmock_main_la_SOURCES = googletest-release-1.10.0/googlemock/src/gmock-all.cc googletest-release-1.10.0/googlemock/src/gmock_main.cc
libgmock_main_la_CPPFLAGS = -I$(srcdir)/googletest-release-$(GOOGLETEST_MIN_VERSION)/googlemock -I$(srcdir)/googletest-release-$(GOOGLETEST_MIN_VERSION)/googlemock/include -I$(srcdir)/googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest/include
libgmock_main_la_SOURCES = googletest-release-$(GOOGLETEST_MIN_VERSION)/googlemock/src/gmock-all.cc googletest-release-$(GOOGLETEST_MIN_VERSION)/googlemock/src/gmock_main.cc

# Hack: auto-download googletest.

googletest-release-1.10.0/googletest/src/gtest-all.cc \
googletest-release-1.10.0/googletest/src/gtest_main.cc \
googletest-release-1.10.0/googlemock/src/gmock-all.cc \
googletest-release-1.10.0/googlemock/src/gmock_main.cc: setup_gtest
googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest/src/gtest-all.cc \
googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest/src/gtest_main.cc \
googletest-release-$(GOOGLETEST_MIN_VERSION)/googlemock/src/gmock-all.cc \
googletest-release-$(GOOGLETEST_MIN_VERSION)/googlemock/src/gmock_main.cc: setup_gtest

setup_gtest:
./setup.sh
curl https://codeload.github.com/google/googletest/zip/release-$(GOOGLETEST_MIN_VERSION) -o gtest-$(GOOGLETEST_MIN_VERSION).zip
unzip -o gtest-$(GOOGLETEST_MIN_VERSION).zip
touch setup_gtest

check_SCRIPTS = check_num_passes.sh
Expand Down
18 changes: 0 additions & 18 deletions test/setup.sh

This file was deleted.

0 comments on commit 1a91433

Please sign in to comment.