Fix up dependency finding for libg{mock,test}_main

- Look up the corresponding non-*_main libraries via LDFLAGS using the
  directories provided in src.libnames.mk. This will allow the libraries to
  be built in the "make libraries" phase of buildworld.
- gtest_main relies on gtest, but didn't explicitly call out the dependency
  in `LIBADD`. Fill in this missing blank.
This commit is contained in:
Enji Cooper 2019-02-20 00:19:11 +00:00
parent 1ab321591f
commit df13161740
2 changed files with 9 additions and 1 deletions

View File

@ -12,7 +12,11 @@ CXXFLAGS+= -I${GOOGLEMOCK_SRCROOT}/include
CXXFLAGS+= -I${GOOGLEMOCK_SRCROOT}
CXXFLAGS+= -I${GOOGLETEST_SRCROOT}/include
LIBADD= gmock
LIBADD+= gmock
# NB: LDFLAGS added for buildworld builds
LDFLAGS+= -L${LIBGTESTDIR}
LDFLAGS+= -L${LIBGMOCKDIR}
SRCS+= gmock_main.cc
SUBDIR.${MK_TESTS}+= tests

View File

@ -11,6 +11,10 @@ PRIVATELIB= true
CXXFLAGS+= -I${GOOGLETEST_SRCROOT}/include
CXXFLAGS+= -I${GOOGLETEST_SRCROOT}
LIBADD+= gtest
# NB: LDFLAGS added for buildworld builds
LDFLAGS+= -L${LIBGTESTDIR}
SRCS+= gtest_main.cc
SUBDIR.${MK_TESTS}+= tests