mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-25 04:11:44 +00:00
configure: add test for C++17 feature "constexpr if"
This commit is contained in:
parent
01a2c80f45
commit
f13c9c83fe
@ -506,6 +506,29 @@ AC_DEFUN([AX_CXX17_STD_GCD],[
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([AX_CXX17_CONSTEXPR_IF],[
|
||||
AC_CACHE_CHECK([for support for C++17 feature "constexpr if"], [ax_cv_cxx17_constexpr_if],[
|
||||
|
||||
CXXFLAGS_SAVED=$CXXFLAGS
|
||||
CXXFLAGS="$CXXFLAGS $STD_CXX"
|
||||
export CXXFLAGS
|
||||
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_TRY_COMPILE(
|
||||
[],
|
||||
[if constexpr (true) return 42; else return 54;],
|
||||
[ax_cv_cxx17_constexpr_if="yes"],
|
||||
[ax_cv_cxx17_constexpr_if="no"])
|
||||
AC_LANG_POP
|
||||
|
||||
CXXFLAGS="$CXXFLAGS_SAVED"
|
||||
])
|
||||
|
||||
if ! test x"$ax_cv_cxx17_constexpr_if" = xyes ; then
|
||||
missing_cxx_features="$missing_cxx_features\n * constexpr if (C++17)"
|
||||
fi
|
||||
])
|
||||
|
||||
dnl AC_DEFUN([AX_CXX17_DEF_NAME],[
|
||||
dnl AC_CACHE_CHECK([for support for C++17 feature "human"], [ax_cv_cxx17_def_name],[
|
||||
dnl
|
||||
@ -548,6 +571,7 @@ AX_CXX17_NESTED_NAMESPACE_DEFINITION
|
||||
AX_CXX17_STRUCTURED_BINDINGS
|
||||
AX_CXX17_STD_OPTIONAL
|
||||
AX_CXX17_STD_GCD
|
||||
AX_CXX17_CONSTEXPR_IF
|
||||
|
||||
if test x"$missing_cxx_features" != x ; then
|
||||
printf "The following features of the C++11/C++14/C++17 standards are not supported by $CXX:$missing_cxx_features\n"
|
||||
|
Loading…
Reference in New Issue
Block a user