From 938ae84bd8be5d9b50370a3f4ce4c832d85241f9 Mon Sep 17 00:00:00 2001 From: Patrick Lodder Date: Thu, 29 Feb 2024 10:28:10 -0500 Subject: [PATCH] build: allow c++14 standard to be used for compilation This will allow testing the codebase against newer standards and increase compatibility with newer dependencies. Cherry-picked from: b99be149 Github Pull Request: #3458 --- configure.ac | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 38cbf0189..32da247c8 100644 --- a/configure.ac +++ b/configure.ac @@ -56,8 +56,21 @@ case $host in lt_cv_deplibs_check_method="pass_all" ;; esac -dnl Require C++11 compiler (no GNU extensions) -AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory], [nodefault]) + +AC_ARG_ENABLE([c++14], + [AS_HELP_STRING([--enable-c++14], + [enable compilation in c++14 mode (disabled by default)])], + [use_cxx14=$enableval], + [use_cxx14=no]) + +dnl Require C++11 or C++14 compiler (no GNU extensions) +if test "x$use_cxx14" = xyes; then + AX_CXX_COMPILE_STDCXX([14], [noext], [mandatory], [nodefault]) +else + AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory], [nodefault]) +fi + + dnl Check if -latomic is required for CHECK_ATOMIC