diff options
author | Mike Frysinger <vapier@chromium.org> | 2016-01-25 19:27:56 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@chromium.org> | 2016-01-25 19:27:56 -0500 |
commit | f820ead9015e9cecb87fea62154b3f33da1baf20 (patch) | |
tree | 26cada78ec678f1f94ea3b99fe05dd870f26b013 /configure.ac | |
parent | build: clean up .dwo files (diff) | |
download | breakpad-f820ead9015e9cecb87fea62154b3f33da1baf20.tar.xz |
test: allow use of system gmock/gtest libs
Some systems provide prebuilt copies of gmock/gtest (such as Chromium
OS). Add a configure flag so they can take advantage of that. This
allows for a smaller checkout as they don't need to include the full
testing/ tree.
BUG=chromium:579384
TEST=`make check` passes w/--enable-system-test-libs
TEST=`make check` passes w/--disable-system-test-libs
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1638653002 .
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index cbea712f..18426ae1 100644 --- a/configure.ac +++ b/configure.ac @@ -135,6 +135,39 @@ if test x$LINUX_HOST = xfalse -a x$disable_processor = xtrue -a x$disable_tools AC_MSG_ERROR([--disable-processor and --disable-tools were specified, and not building for Linux. Nothing to build!]) fi +AC_ARG_ENABLE(system-test-libs, + AS_HELP_STRING([--enable-system-test-libs], + [Use gtest/gmock/etc... from the system instead ] + [of the local copies (default is local)]), + [case "${enableval}" in + yes) + system_test_libs=true + ;; + no) + system_test_libs=false + ;; + *) + AC_MSG_ERROR(bad value ${enableval} for --enable-system-test-libs) + ;; + esac], + [system_test_libs=false]) +AM_CONDITIONAL(SYSTEM_TEST_LIBS, test x$system_test_libs = xtrue) + +AC_ARG_VAR([GMOCK_CONFIG], [Path to gmock-config script]) +AC_ARG_VAR([GMOCK_CFLAGS], [Compiler flags for gmock]) +AC_ARG_VAR([GMOCK_LIBS], [Linker flags for gmock]) +AC_ARG_VAR([GTEST_CONFIG], [Path to gtest-config script]) +AC_ARG_VAR([GTEST_CFLAGS], [Compiler flags for gtest]) +AC_ARG_VAR([GTEST_LIBS], [Linker flags for gtest]) +if test x$system_test_libs = xtrue; then + AC_CHECK_TOOL([GMOCK_CONFIG], [gmock-config]) + AC_CHECK_TOOL([GTEST_CONFIG], [gtest-config]) + GMOCK_CFLAGS=`$GMOCK_CONFIG --cppflags --cxxflags` + GMOCK_LIBS=`$GMOCK_CONFIG --ldflags --libs` + GTEST_CFLAGS=`$GTEST_CONFIG --cppflags --cxxflags` + GTEST_LIBS=`$GTEST_CONFIG --ldflags --libs` +fi + AC_ARG_ENABLE(selftest, AS_HELP_STRING([--enable-selftest], [Run extra tests with "make check" ] |