1# $FreeBSD$ 2 3.include "${.CURDIR}/../Makefile.common" 4.PATH: ${.CURDIR:H} 5 6PLAIN_TESTS_CXX= zfsd_unittest 7SRCS.zfsd_unittest:= ${SRCS:Nzfsd_main.cc} 8SRCS.zfsd_unittest+= libmocks.c zfsd_unittest.cc 9SRCS= 10 11# Use #include <zfsd/xxx.h> in test programs. 12INCFLAGS+= -I${.CURDIR:H:H} 13 14.if defined(DESTDIR) || defined(SYSROOT) 15INCFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include 16LDFLAGS.zfsd_unittest+= -L${SYSROOT:U${DESTDIR}}/lib \ 17 -L${SYSROOT:U${DESTDIR}}/usr/lib 18.endif 19 20# Googletest options 21INCFLAGS+= -I${LOCALBASE}/include -D_THREAD_SAFE -pthread 22LDFLAGS.zfsd_unittest+= -L${LOCALBASE}/lib -D_THREAD_SAFE -pthread 23LDADD.zfsd_unittest+= ${LOCALBASE}/lib/libgtest.a 24 25# GoogleMock options 26LDADD.zfsd_unittest+= ${LOCALBASE}/lib/libgmock.a ${LOCALBASE}/lib/libgmock_main.a 27 28# Googlemock fails if we don't have this line 29# https://groups.google.com/forum/#!msg/googletestframework/h8ixEPCFm0o/amwfu4xGJb0J 30CFLAGS.zfsd_unittest+= -DGTEST_HAS_PTHREAD 31 32.include <bsd.test.mk> 33