diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 64c1c171..398b1608 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -23,7 +23,7 @@ stages: - bash: | export CFLAGS="-ggdb3 -O2" - ./autogen.sh --prefix=/usr --enable-warnaserror + ./autogen.sh --prefix=/usr --enable-warnaserror --enable-unittests make -j4 sudo make install displayName: 'Build and Install libgdiplus' @@ -87,7 +87,7 @@ stages: - bash: | export CFLAGS="-m64 -arch x86_64 -mmacosx-version-min=10.9" export LDFLAGS="-m64 -arch x86_64" - ./autogen.sh --prefix=/tmp/libgdiplus-dev --enable-warnaserror --without-x11 --host=x86_64-apple-darwin13.0.0 --build=x86_64-apple-darwin13.0.0 + ./autogen.sh --prefix=/tmp/libgdiplus-dev --enable-warnaserror --enable-unittests --without-x11 --host=x86_64-apple-darwin13.0.0 --build=x86_64-apple-darwin13.0.0 make -j4 make install displayName: 'Build and Install libgdiplus' diff --git a/Makefile.am b/Makefile.am index 9ac01e10..d581805c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,11 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = src tests -DIST_SUBDIRS = src tests +if BUILD_UNIT_TESTS +SUBDIRS_TESTS = tests +endif + +SUBDIRS = src $(SUBDIRS_TESTS) +DIST_SUBDIRS = src $(SUBDIRS_TESTS) pkgconfigdir = $(libdir)/pkgconfig diff --git a/configure.ac b/configure.ac index 68f1852b..eec847ca 100644 --- a/configure.ac +++ b/configure.ac @@ -41,6 +41,10 @@ AC_ARG_WITH(pango, [ --with-pango use Pango to measure and draw text GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -std=gnu11" +AC_ARG_ENABLE(unittests, AS_HELP_STRING([--enable-unittests],[Enable building unit tests.]),[unittests=yes],[unittests=no]) + +AM_CONDITIONAL([BUILD_UNIT_TESTS], [test x$unittests = xyes]) + AC_ARG_ENABLE(warnaserror, AS_HELP_STRING([--enable-warnaserror],[Enable treating warnings as errors.]),[warnaserror=yes],[warnaserror=no]) if test $warnaserror = "yes"; then