Skip to content

Commit 7829685

Browse files
committed
Add configure option for c++17
1 parent 0fbde48 commit 7829685

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

configure.ac

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,20 @@ case $host in
6161
lt_cv_deplibs_check_method="pass_all"
6262
;;
6363
esac
64-
dnl Require C++11 compiler (no GNU extensions)
65-
AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
64+
65+
AC_ARG_ENABLE([c++17],
66+
[AS_HELP_STRING([--enable-c++17],
67+
[enable compilation in c++17 mode (disabled by default)])],
68+
[use_cxx17=$enableval],
69+
[use_cxx17=no])
70+
71+
dnl Require C++11 or C++17 compiler (no GNU extensions)
72+
if test "x$use_cxx17" = xyes; then
73+
AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
74+
else
75+
AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
76+
fi
77+
6678
dnl Check if -latomic is required for <std::atomic>
6779
CHECK_ATOMIC
6880

0 commit comments

Comments
 (0)