]> git.sesse.net Git - movit/commitdiff
Merge branch 'master' into epoxy
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 12 Mar 2014 00:25:39 +0000 (01:25 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 12 Mar 2014 00:25:39 +0000 (01:25 +0100)
Conflicts:
Makefile.in

1  2 
Makefile.in
configure.ac

diff --combined Makefile.in
index 0c2e9eed6f9f6bfa31c42b53f81440486c4fe81c,fadd3a32200136573f58a8b013cf339032307867..3a2461f41edf6a55d0d106aed69767b5a3a79b37
@@@ -8,23 -8,20 +8,24 @@@ datarootdir = @datarootdir
  datadir = @datadir@
  top_builddir = @top_builddir@
  with_demo_app = @with_demo_app@
 +with_SDL2 = @with_SDL2@
+ with_coverage = @with_coverage@
  
  CC=@CC@
  CXX=@CXX@
 -CXXFLAGS=-Wall @CXXFLAGS@ -I$(GTEST_DIR)/include @Eigen3_CFLAGS@ @GLEW_CFLAGS@
 -LDFLAGS=@GLEW_LIBS@ @SDL_LIBS@ -lpthread
 -DEMO_LDLIBS=@SDL_image_LIBS@ -lrt -lpthread @libpng_LIBS@
 +CXXFLAGS=-Wall @CXXFLAGS@ -I$(GTEST_DIR)/include @SDL2_CFLAGS@ @SDL_CFLAGS@ @Eigen3_CFLAGS@ @epoxy_CFLAGS@
 +ifeq ($(with_SDL2),yes)
 +CXXFLAGS += -DHAVE_SDL2
 +endif
 +LDFLAGS=@epoxy_LIBS@ @SDL2_LIBS@ @SDL_LIBS@ -lpthread
 +DEMO_LDLIBS=@SDL2_image_LIBS@ @SDL_image_LIBS@ -lrt -lpthread @libpng_LIBS@
  SHELL=@SHELL@
  LIBTOOL=@LIBTOOL@ --tag=CXX
  RANLIB=ranlib
  INSTALL=install
  MKDIR=mkdir
  
- ifeq ($(COVERAGE),1)
+ ifeq ($(with_coverage),yes)
  CXXFLAGS += -fprofile-arcs -ftest-coverage --coverage
  LDFLAGS += -fprofile-arcs -ftest-coverage
  LDLIBS += -lgcov
@@@ -131,11 -128,16 +132,16 @@@ check: $(TESTS
                exit 1; \
        fi
  
- # You need to build with COVERAGE=1 to use this target.
+ ifeq ($(with_coverage),yes)
  coverage: check
        lcov -d . -c -o movit.info
        lcov --remove movit.info '*_test.cpp' 'test_util.*' 'sandbox_effect.*' widgets.cpp -o movit.info
        genhtml -o coverage movit.info
+ else
+ coverage:
+       @echo You need to compile with --enable-coverage to use this target.
+       @exit 1
+ endif
  
  HDRS = effect_chain.h effect_util.h effect.h input.h image_format.h init.h util.h defs.h resource_pool.h
  HDRS += $(INPUTS:=.h)
diff --combined configure.ac
index 79e99cadbaf0162dba9c83cf17968339ebed5261,5e032345d778ddf14b53fe6e0aeb2a241410d8ca..f9117465aa9625ba7adb09bf8ca16d32783a4421
@@@ -7,26 -7,21 +7,30 @@@ AC_CONFIG_SRCDIR(effect.cpp
  AC_PROG_CC
  AC_PROG_CXX
  PKG_CHECK_MODULES([Eigen3], [eigen3])
 -PKG_CHECK_MODULES([GLEW], [glew])
 +PKG_CHECK_MODULES([epoxy], [epoxy])
  
 -# Needed for unit tests and the demo app.
 -PKG_CHECK_MODULES([SDL], [sdl])
 +# Needed for unit tests and the demo app. We prefer SDL2 if possible,
 +# but can also use classic SDL.
 +with_SDL2=no
 +with_demo_app=yes
 +PKG_CHECK_MODULES([SDL2], [sdl2], [with_SDL2=yes], [
 +  PKG_CHECK_MODULES([SDL], [sdl])
 +])
  
  # These are only needed for the demo app.
 -with_demo_app=yes
 -PKG_CHECK_MODULES([SDL_image], [SDL_image], [], [with_demo_app=no; AC_MSG_WARN([SDL_image not found, demo program will not be built])])
 +if test $with_SDL2 = "yes"; then
 +  PKG_CHECK_MODULES([SDL2_image], [SDL2_image], [], [with_demo_app=no; AC_MSG_WARN([SDL2_image not found, demo program will not be built])])
 +else
 +  PKG_CHECK_MODULES([SDL_image], [SDL_image], [], [with_demo_app=no; AC_MSG_WARN([SDL_image not found, demo program will not be built])])
 +fi
  PKG_CHECK_MODULES([libpng], [libpng12], [], [with_demo_app=no; AC_MSG_WARN([libpng12 not found, demo program will not be built])])
  
  AC_SUBST([with_demo_app])
 +AC_SUBST([with_SDL2])
  
+ with_coverage=no
+ AC_ARG_ENABLE([coverage], [  --enable-coverage       build with information needed to compute test coverage], [with_coverage=yes])
+ AC_SUBST([with_coverage])
  AC_CONFIG_FILES([Makefile movit.pc])
  AC_OUTPUT