0001-Build-unit-tests-only-when-enable-unit-tests-is-pass.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From ae92a466e203c8aec43f682a3a7aa617b820c3ba Mon Sep 17 00:00:00 2001
  2. From: Sergio Prado <sergio.prado@e-labworks.com>
  3. Date: Sat, 10 Apr 2021 11:03:38 -0300
  4. Subject: [PATCH] Build unit tests only when --enable-unit-tests is passed
  5. Building unit tests by default requires all dependencies to be
  6. installed (jpeg, tiff, etc) and users may not want that.
  7. So let's disable the build of unit tests by default and introduce
  8. --enable-unit-tests configure option to enable it.
  9. Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>
  10. Upstream: https://github.com/mono/libgdiplus/pull/701
  11. ---
  12. Makefile.am | 8 ++++++--
  13. configure.ac | 4 ++++
  14. 2 files changed, 10 insertions(+), 2 deletions(-)
  15. diff --git a/Makefile.am b/Makefile.am
  16. index f40bdee0c2e9..152e0d64fdd9 100644
  17. --- a/Makefile.am
  18. +++ b/Makefile.am
  19. @@ -1,7 +1,11 @@
  20. ACLOCAL_AMFLAGS = -I m4
  21. -SUBDIRS = src tests
  22. -DIST_SUBDIRS = src tests
  23. +if BUILD_UNIT_TESTS
  24. +SUBDIRS_TESTS = tests
  25. +endif
  26. +
  27. +SUBDIRS = src $(SUBDIRS_TESTS)
  28. +DIST_SUBDIRS = src $(SUBDIRS_TESTS)
  29. pkgconfigdir = $(libdir)/pkgconfig
  30. diff --git a/configure.ac b/configure.ac
  31. index 098fd0a664bd..c126ff091e58 100644
  32. --- a/configure.ac
  33. +++ b/configure.ac
  34. @@ -39,6 +39,10 @@ if test $warnaserror = "yes"; then
  35. GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS -Werror -Wno-unknown-warning-option -Wno-clobbered -Wno-typedef-redefinition"
  36. fi
  37. +AC_ARG_ENABLE(unittests, AS_HELP_STRING([--enable-unittests],[Enable building unit tests.]),[unittests=yes],[unittests=no])
  38. +
  39. +AM_CONDITIONAL([BUILD_UNIT_TESTS], [test x$unittests = xyes])
  40. +
  41. AC_ARG_ENABLE(asan, AS_HELP_STRING([--enable-asan],[Enable address sanitizer.]),[asan=yes],[asan=no])
  42. if test $asan = "yes"; then
  43. --
  44. 2.17.1