Commit 762f232146f3edc234c898b48e9daacf72ee9577
1 parent
db4ec7a9
Add CI build for next C++ version
Showing
3 changed files
with
28 additions
and
1 deletions
.github/workflows/main.yml
| ... | ... | @@ -147,3 +147,11 @@ jobs: |
| 147 | 147 | - uses: actions/checkout@v3 |
| 148 | 148 | - name: 'Unsigned Char Tests' |
| 149 | 149 | run: build-scripts/test-unsigned-char |
| 150 | + CxxNext: | |
| 151 | + runs-on: ubuntu-latest | |
| 152 | + # Build after Fuzzers to save concurrent runners | |
| 153 | + needs: Fuzzers | |
| 154 | + steps: | |
| 155 | + - uses: actions/checkout@v3 | |
| 156 | + - name: 'Build with Next C++ standard' | |
| 157 | + run: build-scripts/test-c++-next | ... | ... |
CMakeLists.txt
| ... | ... | @@ -106,6 +106,7 @@ option(INSTALL_CMAKE_PACKAGE "Install cmake package files" ON) |
| 106 | 106 | option(INSTALL_EXAMPLES "Install example files" ON) |
| 107 | 107 | |
| 108 | 108 | option(FUTURE "Include ABI-breaking changes CONSIDERED for the next major release" OFF) |
| 109 | +option(CXX_NEXT "Build with next C++ standard version" OFF) | |
| 109 | 110 | |
| 110 | 111 | # *** END OPTIONS *** |
| 111 | 112 | |
| ... | ... | @@ -166,7 +167,11 @@ Please build with cmake in a subdirectory, e.g. |
| 166 | 167 | Please remove CMakeCache.txt and the CMakeFiles directories.") |
| 167 | 168 | endif() |
| 168 | 169 | |
| 169 | -set(CMAKE_CXX_STANDARD 17) | |
| 170 | +if(CXX_NEXT) | |
| 171 | + set(CMAKE_CXX_STANDARD 20) | |
| 172 | +else() | |
| 173 | + set(CMAKE_CXX_STANDARD 17) | |
| 174 | +endif() | |
| 170 | 175 | set(CMAKE_CXX_EXTENSIONS OFF) |
| 171 | 176 | set(CMAKE_CXX_STANDARD_REQUIRED ON) |
| 172 | 177 | set(CMAKE_C_VISIBILITY_PRESET hidden) | ... | ... |
build-scripts/test-c++-next
0 → 100755
| 1 | +#!/bin/bash | |
| 2 | +set -e | |
| 3 | +sudo apt-get update | |
| 4 | +sudo apt-get -y install \ | |
| 5 | + build-essential cmake \ | |
| 6 | + zlib1g-dev libjpeg-dev libgnutls28-dev libssl-dev | |
| 7 | +cmake -S . -B build \ | |
| 8 | + -DCXX_NEXT=ON \ | |
| 9 | + -DCI_MODE=1 -DBUILD_STATIC_LIBS=0 -DCMAKE_BUILD_TYPE=Release \ | |
| 10 | + -DREQUIRE_CRYPTO_OPENSSL=1 -DREQUIRE_CRYPTO_GNUTLS=1 \ | |
| 11 | + -DENABLE_QTC=1 | |
| 12 | +cmake --build build --verbose -j$(nproc) -- -k | |
| 13 | +cd build | |
| 14 | +ctest --verbose | ... | ... |