Handle --with-cxx=20 configure option too

Although wxWidgets doesn't use any C++20 features yet, still allow
compiling it in C++ 20 mode if wanted.

Update the helper macro for detecting available C++ version support from
https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
with just a minor change to de-TAB-ify it to pass our code style check
forbidding indenting with TABs.

Closes #22238.
This commit is contained in:
Vadim Zeitlin
2022-03-27 18:06:27 +02:00
parent d47119680f
commit 762c80b809
3 changed files with 4181 additions and 9 deletions

View File

@@ -665,7 +665,7 @@ dnl ---------------------------------------------------------------------------
WX_ARG_DISABLE(shared, [ --disable-shared create static library instead of shared], wxUSE_SHARED)
AC_ARG_ENABLE(cxx11, [ --enable-cxx11 use C++11 compiler if available], [wxWITH_CXX=11 wxWITH_CXX_IS_OPTIONAL=1])
AC_ARG_WITH(cxx, [ --with-cxx=11|14|17 use the given C++ dialect], [wxWITH_CXX="$withval"])
AC_ARG_WITH(cxx, [ --with-cxx=11|14|17|20 use the given C++ dialect], [wxWITH_CXX="$withval"])
WX_ARG_ENABLE(stl, [ --enable-stl use standard C++ classes for everything], wxUSE_STL)
if test "$wxUSE_STL" = "yes"; then
DEFAULT_wxUSE_STD_CONTAINERS=yes
@@ -1156,8 +1156,13 @@ if test -n "$wxWITH_CXX"; then
HAVE_CXX11=1
;;
20)
AX_CXX_COMPILE_STDCXX(20)
HAVE_CXX11=1
;;
*)
AC_MSG_ERROR([Invalid --with-cxx=$wxWITH_CXX option value, only 11, 14 or 17 supported])
AC_MSG_ERROR([Invalid --with-cxx=$wxWITH_CXX option value, only 11, 14, 17 or 20 supported])
esac
if test "$HAVE_CXX11" = "1" ; then