Skip to content

Commit

Permalink
Build unit tests only when --enable-unittests is passed
Browse files Browse the repository at this point in the history
Building unit tests by default requires all dependencies to be
installed (jpeg, tiff, etc) and users may not want that.

So let's disable the build of unit tests by default and introduce
--enable-unittests configure option to enable it.

Signed-off-by: Sergio Prado <[email protected]>
  • Loading branch information
sergioprado committed Apr 10, 2021
1 parent e15e1e0 commit d81203a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d81203a

Please sign in to comment.