summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@ubuntu.com>2011-12-14 11:34:01 -0800
committerChase Douglas <chase.douglas@ubuntu.com>2011-12-14 11:34:01 -0800
commit5f10cf0d7bc2492e53bba8dc2105c8a9b8445a18 (patch)
tree6679d4ae82ff3cb4307a61e8812a995827eeebb2
parentc8a4e665b558f2e39b63bfe91a7081fc041887c2 (diff)
Fix gtest cpp flags
-rw-r--r--Makefile.am9
-rw-r--r--configure.ac3
-rw-r--r--examples/Makefile.am6
-rw-r--r--m4/gtest.m43
4 files changed, 15 insertions, 6 deletions
diff --git a/Makefile.am b/Makefile.am
index b0319ac..b79c16c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,6 +7,10 @@ libxorg_gtest_la_SOURCES = \
src/process.cpp \
src/test.cpp
+libxorg_gtest_la_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ $(GTEST_CPPFLAGS)
+
libxorg_gtest_main_la_SOURCES = \
src/main.cpp
@@ -19,7 +23,10 @@ library_include_HEADERS = \
library_datadir = $(datadir)/xorg/gtest
library_data_DATA = conf/dummy.conf
-libxorg_gtest_main_la_CPPFLAGS = $(AM_CPPFLAGS) -DDUMMY_CONF_PATH="\"$(library_datadir)/dummy.conf\""
+libxorg_gtest_main_la_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ $(GTEST_CPPFLAGS) \
+ -DDUMMY_CONF_PATH="\"$(library_datadir)/dummy.conf\""
libxorg_gtest_la_LDFLAGS = $(X11_LIBS)
libxorg_gtest_main_la_LDFLAGS = $(X11_LIBS)
diff --git a/configure.ac b/configure.ac
index 6b56e3f..9e58dc4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,8 +34,7 @@ AC_CHECK_GTEST
AS_IF([test "x$ac_cv_lib_gtest_main" != xyes],
AC_MSG_ERROR([package 'gtest' not found]))
-AC_SUBST([GTEST_LDFLAGS])
-AC_SUBST([GTEST_CXXFLAGS])
+AC_SUBST([GTEST_CPPFLAGS])
AC_SUBST(DUMMY_CONF_PATH, "$datadir/xorg/gtest/dummy.conf")
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 9bb5ee7..3f6a8cc 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -22,4 +22,8 @@ noinst_PROGRAMS = xorg_gtest_example
xorg_gtest_example_SOURCES = xorg-gtest.cpp
-xorg_gtest_example_LDFLAGS = -lxorg-gtest -lxorg-gtest_main -lgtest -lpthread -lX11 \ No newline at end of file
+xorg_gtest_example_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ $(GTEST_CPPFLAGS)
+
+xorg_gtest_example_LDFLAGS = -lxorg-gtest -lxorg-gtest_main -lgtest -lpthread -lX11
diff --git a/m4/gtest.m4 b/m4/gtest.m4
index 0839ce2..cd41b21 100644
--- a/m4/gtest.m4
+++ b/m4/gtest.m4
@@ -8,8 +8,7 @@ AC_DEFUN([AC_CHECK_GTEST],
AC_ARG_WITH([gtest-include-path],
[AS_HELP_STRING([--with-gtest-include-path],
[location of the Google test headers, defaults to /usr/include])],
- [GTEST_CXXFLAGS="-I$withval"],
- [GTEST_CXXFLAGS='-I/usr/include'])
+ [GTEST_CPPFLAGS="-I$withval"])
AC_ARG_WITH([gtest-lib-path],
[AS_HELP_STRING([--with-gtest-lib-path], [location of the Google test libraries])],