mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-09 11:27:28 -03:00
build: Require C++20 compiler
This commit is contained in:
parent
dce1dfbc47
commit
fa67f096bd
7 changed files with 8 additions and 18 deletions
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
@ -62,12 +62,12 @@ jobs:
|
|||
echo "TEST_BASE=$(git rev-list -n$((${{ env.MAX_COUNT }} + 1)) --reverse HEAD ^$(git rev-list -n1 --merges HEAD)^@ | head -1)" >> "$GITHUB_ENV"
|
||||
- run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install clang ccache build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libminiupnpc-dev libnatpmp-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools qtwayland5 libqrencode-dev -y
|
||||
sudo apt-get install clang-15 ccache build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libminiupnpc-dev libnatpmp-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools qtwayland5 libqrencode-dev -y
|
||||
- name: Compile and run tests
|
||||
run: |
|
||||
# Run tests on commits after the last merge commit and before the PR head commit
|
||||
# Use clang++, because it is a bit faster and uses less memory than g++
|
||||
git rebase --exec "echo Running test-one-commit on \$( git log -1 ) && ./autogen.sh && CC=clang CXX=clang++ ./configure && make clean && make -j $(nproc) check && ./test/functional/test_runner.py -j $(( $(nproc) * 2 ))" ${{ env.TEST_BASE }}
|
||||
git rebase --exec "echo Running test-one-commit on \$( git log -1 ) && ./autogen.sh && CC=clang-15 CXX=clang++-15 ./configure && make clean && make -j $(nproc) check && ./test/functional/test_runner.py -j $(( $(nproc) * 2 ))" ${{ env.TEST_BASE }}
|
||||
|
||||
macos-native-x86_64:
|
||||
name: 'macOS 13 native, x86_64, no depends, sqlite only, gui'
|
||||
|
|
|
@ -983,7 +983,7 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[
|
|||
|
||||
#error "This is not a C++ compiler"
|
||||
|
||||
#elif __cplusplus < 202002L
|
||||
#elif __cplusplus < 201709L // Temporary patch on top of upstream to allow g++-10
|
||||
|
||||
#error "This is not a C++20 compiler"
|
||||
|
||||
|
|
12
configure.ac
12
configure.ac
|
@ -96,18 +96,8 @@ case $host in
|
|||
;;
|
||||
esac
|
||||
|
||||
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
|
||||
dnl Require C++20 compiler (no GNU extensions)
|
||||
AX_CXX_COMPILE_STDCXX([20], [noext], [mandatory])
|
||||
fi
|
||||
|
||||
dnl Unless the user specified OBJCXX, force it to be the same as CXX. This ensures
|
||||
dnl that we get the same -std flags for both.
|
||||
|
|
|
@ -49,7 +49,7 @@ NO_HARDEN ?=
|
|||
FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources
|
||||
|
||||
C_STANDARD ?= c11
|
||||
CXX_STANDARD ?= c++17
|
||||
CXX_STANDARD ?= c++20
|
||||
|
||||
BUILD = $(shell ./config.guess)
|
||||
HOST ?= $(BUILD)
|
||||
|
|
|
@ -98,7 +98,7 @@ The following can be set when running make: `make FOO=bar`
|
|||
- `SDK_PATH`: Path where SDKs can be found (used by macOS)
|
||||
- `FALLBACK_DOWNLOAD_PATH`: If a source file can't be fetched, try here before giving up
|
||||
- `C_STANDARD`: Set the C standard version used. Defaults to `c11`.
|
||||
- `CXX_STANDARD`: Set the C++ standard version used. Defaults to `c++17`.
|
||||
- `CXX_STANDARD`: Set the C++ standard version used. Defaults to `c++20`.
|
||||
- `NO_BOOST`: Don't download/build/cache Boost
|
||||
- `NO_LIBEVENT`: Don't download/build/cache Libevent
|
||||
- `NO_QT`: Don't download/build/cache Qt and its dependencies
|
||||
|
|
|
@ -41,7 +41,7 @@ $(package)_config_opts_release += -silent
|
|||
$(package)_config_opts_debug = -debug
|
||||
$(package)_config_opts_debug += -optimized-tools
|
||||
$(package)_config_opts += -bindir $(build_prefix)/bin
|
||||
$(package)_config_opts += -c++std c++17
|
||||
$(package)_config_opts += -c++std c++2a
|
||||
$(package)_config_opts += -confirm-license
|
||||
$(package)_config_opts += -hostprefix $(build_prefix)
|
||||
$(package)_config_opts += -no-compile-examples
|
||||
|
|
|
@ -43,5 +43,5 @@ SpacesInAngles: false
|
|||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
Standard: c++17
|
||||
Standard: c++20
|
||||
UseTab: Never
|
||||
|
|
Loading…
Reference in a new issue