aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2022-03-24 12:38:42 +0000
committerfanquake <fanquake@gmail.com>2022-03-24 13:01:01 +0000
commit213e98ca826eb25c7d6e26729c6a3de6521614ba (patch)
treea257bb01402c080212ad0e34c0044aecdf12f6f9 /configure.ac
parente7b6272b305386a264adf2c04b7bebfb8499070f (diff)
parent999982b06ce1d1280e5ce48f9253c6c536f41a12 (diff)
downloadbitcoin-213e98ca826eb25c7d6e26729c6a3de6521614ba.tar.xz
Merge bitcoin/bitcoin#24169: build: Add --enable-c++20 option
999982b06ce1d1280e5ce48f9253c6c536f41a12 build: Add --enable-c++20 option (MarcoFalke) fae679065e4ef0c6383bbdd1876aaed6c1e40104 Add CSerializedNetMsg::Copy() helper (MarcoFalke) fabb7c4ba629ecdea80a23674e2659d3d391565f Make fs.h C++20 compliant (MarcoFalke) fae2220f4e48934313389864d3d362f672627eb8 scheduler: Capture ‘this’ explicitly in lambda (MarcoFalke) Pull request description: This is for CI and devs only and doesn't change that C++17 is the standard we are currently using. The option `--enable-c++20` allows CI to check that the C++17 code in the repo is also valid C++20. (There are some cases where valid C++17 doesn't compile under C++20). Also, it allows developers to easily play with C++20 in the codebase. ACKs for top commit: ryanofsky: Code review ACK 999982b06ce1d1280e5ce48f9253c6c536f41a12. Since last review was rebased, and enum-conversion change was dropped, and CSerializedNetMsg copy workaround was added fanquake: utACK 999982b06ce1d1280e5ce48f9253c6c536f41a12 Tree-SHA512: afc95ba03ea2b937017fc8e2b1449379cd2b6f7093c430d2e344c665a00c51e402d6651cbcbd0be8118ea1e54c3a86e67d2021d19ba1d4da67168e9fcb6b6f83
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 10 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 3b355eb7b6..298b72a381 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