Browse Source

[master] fix linker problem in lib/cc unit test

move GTEST_LDADD to the end of the list, so that the source tree libs get linked instead of those installed in the same location as gtest
(reviewed on jabber by jinmei)
Jelte Jansen 13 years ago
parent
commit
f173bdf07e
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/lib/cc/tests/Makefile.am

+ 5 - 2
src/lib/cc/tests/Makefile.am

@@ -24,11 +24,14 @@ run_unittests_SOURCES = data_unittests.cc session_unittests.cc run_unittests.cc
 run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
 run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
 
-run_unittests_LDADD = $(GTEST_LDADD)
-run_unittests_LDADD +=  $(top_builddir)/src/lib/cc/libcc.la
+# We need to put our libs first, in case gtest (or any dependency, really)
+# is installed in the same location as a different version of bind10
+# Otherwise the linker may not use the source tree libs 
+run_unittests_LDADD =  $(top_builddir)/src/lib/cc/libcc.la
 run_unittests_LDADD +=  $(top_builddir)/src/lib/log/liblog.la
 run_unittests_LDADD +=  $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
 run_unittests_LDADD +=  $(top_builddir)/src/lib/exceptions/libexceptions.la
+run_unittests_LDADD += $(GTEST_LDADD)
 
 endif