build: Require C++20 compiler

This commit is contained in:
MarcoFalke 2023-08-27 10:45:39 +02:00
parent dce1dfbc47
commit fa67f096bd
No known key found for this signature in database
7 changed files with 8 additions and 18 deletions

View file

@ -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" echo "TEST_BASE=$(git rev-list -n$((${{ env.MAX_COUNT }} + 1)) --reverse HEAD ^$(git rev-list -n1 --merges HEAD)^@ | head -1)" >> "$GITHUB_ENV"
- run: | - run: |
sudo apt-get update 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 - name: Compile and run tests
run: | run: |
# Run tests on commits after the last merge commit and before the PR head commit # 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++ # 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: macos-native-x86_64:
name: 'macOS 13 native, x86_64, no depends, sqlite only, gui' name: 'macOS 13 native, x86_64, no depends, sqlite only, gui'

View file

@ -983,7 +983,7 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[
#error "This is not a C++ compiler" #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" #error "This is not a C++20 compiler"

View file

@ -96,18 +96,8 @@ case $host in
;; ;;
esac esac
AC_ARG_ENABLE([c++20], dnl Require C++20 compiler (no GNU extensions)
[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]) 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 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. dnl that we get the same -std flags for both.

View file

@ -49,7 +49,7 @@ NO_HARDEN ?=
FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources
C_STANDARD ?= c11 C_STANDARD ?= c11
CXX_STANDARD ?= c++17 CXX_STANDARD ?= c++20
BUILD = $(shell ./config.guess) BUILD = $(shell ./config.guess)
HOST ?= $(BUILD) HOST ?= $(BUILD)

View file

@ -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) - `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 - `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`. - `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_BOOST`: Don't download/build/cache Boost
- `NO_LIBEVENT`: Don't download/build/cache Libevent - `NO_LIBEVENT`: Don't download/build/cache Libevent
- `NO_QT`: Don't download/build/cache Qt and its dependencies - `NO_QT`: Don't download/build/cache Qt and its dependencies

View file

@ -41,7 +41,7 @@ $(package)_config_opts_release += -silent
$(package)_config_opts_debug = -debug $(package)_config_opts_debug = -debug
$(package)_config_opts_debug += -optimized-tools $(package)_config_opts_debug += -optimized-tools
$(package)_config_opts += -bindir $(build_prefix)/bin $(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 += -confirm-license
$(package)_config_opts += -hostprefix $(build_prefix) $(package)_config_opts += -hostprefix $(build_prefix)
$(package)_config_opts += -no-compile-examples $(package)_config_opts += -no-compile-examples

View file

@ -43,5 +43,5 @@ SpacesInAngles: false
SpacesInContainerLiterals: true SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false SpacesInCStyleCastParentheses: false
SpacesInParentheses: false SpacesInParentheses: false
Standard: c++17 Standard: c++20
UseTab: Never UseTab: Never