mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-18 20:25:25 +00:00
tests: fix 'make check' build for setups where no c++ compiler is available
Only try to build (pseudo-)C++ unit test if a working C++ compiler has been found, otherwise the build will fail. (We do this to make sure our headers are 'C++ clean').
This commit is contained in:
parent
7e1d9c8c0d
commit
7203806ffb
2 changed files with 14 additions and 4 deletions
11
configure.ac
11
configure.ac
|
@ -228,10 +228,15 @@ AM_PROG_CC_C_O
|
||||||
dnl find an assembler
|
dnl find an assembler
|
||||||
AM_PROG_AS
|
AM_PROG_AS
|
||||||
|
|
||||||
dnl determine c++ compiler
|
|
||||||
AC_PROG_CXX
|
|
||||||
dnl determine if c++ is available on this system
|
dnl determine if c++ is available on this system
|
||||||
AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
|
AC_PROG_CXX
|
||||||
|
dnl CXX may be set to some default even if no c++ compiler is available
|
||||||
|
dnl (thanks autotools!), so just try to compile some c++ code to make sure
|
||||||
|
AC_LANG_PUSH([C++])
|
||||||
|
AC_TRY_COMPILE([ class Foo { int bar; };], , working_cxx=yes, working_cxx=no)
|
||||||
|
AC_LANG_POP([C++])
|
||||||
|
AC_MSG_NOTICE([working c++ compiler found: $working_cxx])
|
||||||
|
AM_CONDITIONAL(HAVE_CXX, test "x$working_cxx" == "xyes")
|
||||||
|
|
||||||
dnl Perl is used in building documentation and in the version checks
|
dnl Perl is used in building documentation and in the version checks
|
||||||
AC_PATH_PROG(PERL_PATH, perl, no)
|
AC_PATH_PROG(PERL_PATH, perl, no)
|
||||||
|
|
|
@ -43,6 +43,11 @@ endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if HAVE_CXX
|
||||||
|
CXX_CHECKS = gst/gstcpp
|
||||||
|
else
|
||||||
|
CXX_CHECKS =
|
||||||
|
endif
|
||||||
|
|
||||||
# if it's calling gst_element_factory_make(), it will probably not work without
|
# if it's calling gst_element_factory_make(), it will probably not work without
|
||||||
# a registry
|
# a registry
|
||||||
|
@ -89,7 +94,7 @@ check_PROGRAMS = \
|
||||||
gst/gstbufferlist \
|
gst/gstbufferlist \
|
||||||
gst/gstbus \
|
gst/gstbus \
|
||||||
gst/gstcaps \
|
gst/gstcaps \
|
||||||
gst/gstcpp \
|
$(CXX_CHECKS) \
|
||||||
gst/gstdatetime \
|
gst/gstdatetime \
|
||||||
gst/gstinfo \
|
gst/gstinfo \
|
||||||
gst/gstiterator \
|
gst/gstiterator \
|
||||||
|
|
Loading…
Reference in a new issue