From 04c71e680ce8d47abca807597aa353e03273eb0a Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Thu, 19 Jan 2023 17:40:13 +1300 Subject: AX_CXX_COMPILE_STDCXX: Fix MSVC with C++17 or later MSVC defaults to C++14 and needs -std:c++NN to enable support for newer versions so add that to the list of options to try. --- m4/ax_cxx_compile_stdcxx.m4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4 index a3d964c..a2e068a 100644 --- a/m4/ax_cxx_compile_stdcxx.m4 +++ b/m4/ax_cxx_compile_stdcxx.m4 @@ -43,7 +43,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 15 +#serial 16 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). @@ -104,8 +104,9 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl dnl HP's aCC needs +std=c++11 according to: dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf dnl Cray's crayCC needs "-h std=c++11" + dnl MSVC needs -std:c++NN for C++17 and later (default is C++14) for alternative in ${ax_cxx_compile_alternatives}; do - for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" -std:c++${alternative}; do cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, $cachevar, -- cgit v1.2.1