build system: test for and use -std=c++17 compiler flag if supported

This commit is contained in:
Moritz Bunkus 2019-05-18 17:12:27 +02:00
parent 5d93db753e
commit 1e7a6b6e31
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85

View File

@ -1,10 +1,10 @@
AC_DEFUN([AX_CXX_STD_CXX_FLAG],[
AC_CACHE_CHECK([for support for the "-std=c++14" flag], [ax_cv_std_cxx_flag],[
AC_CACHE_CHECK([for support for the "-std=c++17" flag], [ax_cv_std_cxx_flag],[
AC_LANG_PUSH(C++)
CXXFLAGS_SAVED="$CXXFLAGS"
for flag in gnu++14 c++14 gnu++11 c++11 c++0x; do
for flag in c++17 gnu++14 c++14 gnu++11 c++11 c++0x; do
CXXFLAGS="$CXXFLAGS_SAVED -std=$flag"
AC_TRY_COMPILE([], [true;], [ax_cv_std_cxx_flag="-std=$flag"], [ax_cv_std_cxx_flag="undecided"])