aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2022-02-11 13:08:55 +0100
committerMarcoFalke <falke.marco@gmail.com>2022-03-24 11:37:42 +0100
commit999982b06ce1d1280e5ce48f9253c6c536f41a12 (patch)
treea1ca9d806ad795669812e6b68d315947dc0c99e3
parentfae679065e4ef0c6383bbdd1876aaed6c1e40104 (diff)
downloadbitcoin-999982b06ce1d1280e5ce48f9253c6c536f41a12.tar.xz
build: Add --enable-c++20 option
-rwxr-xr-xci/test/00_setup_env_native_asan.sh2
-rw-r--r--configure.ac10
2 files changed, 11 insertions, 1 deletions
diff --git a/ci/test/00_setup_env_native_asan.sh b/ci/test/00_setup_env_native_asan.sh
index b03a7edb54..69883e3609 100755
--- a/ci/test/00_setup_env_native_asan.sh
+++ b/ci/test/00_setup_env_native_asan.sh
@@ -11,4 +11,4 @@ export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libevent-
export DOCKER_NAME_TAG=ubuntu:22.04
export NO_DEPENDS=1
export GOAL="install"
-export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' --with-sanitizers=address,integer,undefined CC=clang CXX=clang++"
+export BITCOIN_CONFIG="--enable-c++20 --enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' --with-sanitizers=address,integer,undefined CC=clang CXX=clang++"
diff --git a/configure.ac b/configure.ac
index 63ff6a1ebd..f59418205c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,8 +78,18 @@ AC_ARG_WITH([seccomp],
[seccomp_found=$withval],
[seccomp_found=auto])
+AC_ARG_ENABLE([c++20],
+ [AS_HELP_STRING([--enable-c++20],
+ [enable compilation in c++20 mode (disabled by default)])],
+ [use_cxx20=$enableval],
+ [use_cxx20=no])
+
dnl Require C++17 compiler (no GNU extensions)
+if test "$use_cxx20" = "no"; then
AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
+else
+AX_CXX_COMPILE_STDCXX([20], [noext], [mandatory])
+fi
dnl Check if -latomic is required for <std::atomic>
CHECK_ATOMIC