Skip to content

Commit 7461fc9

Browse files
committed
added ci/cd for c++ standards
1 parent 8046198 commit 7461fc9

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

.github/workflows/cross-platform-build.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,35 @@ jobs:
185185
chmod +x build/vmaware
186186
bash auxiliary/test_cli.sh build/vmaware
187187
188+
cpp-standard:
189+
needs: [linux, macos, windows]
190+
runs-on: ubuntu-latest
191+
timeout-minutes: 10
192+
strategy:
193+
fail-fast: false
194+
matrix:
195+
std: [26, 23, 20, 17, 14, 11]
196+
197+
steps:
198+
- uses: actions/checkout@v4
199+
200+
- name: Install dependencies
201+
run: |
202+
sudo apt-get update -q
203+
sudo apt-get install -y --no-install-recommends g++-14 cmake
204+
205+
- name: Configure (C++${{ matrix.std }})
206+
run: |
207+
cmake -B build \
208+
-DCMAKE_BUILD_TYPE=Release \
209+
-DCMAKE_CXX_STANDARD=${{ matrix.std }} \
210+
-DCMAKE_CXX_COMPILER=g++-14
211+
212+
- name: Build (C++${{ matrix.std }})
213+
run: cmake --build build --config Release
214+
188215
all-platforms:
189-
needs: [linux, macos, windows, cli-test]
216+
needs: [linux, macos, windows, cli-test, cpp-standard]
190217
runs-on: ubuntu-latest
191218
steps:
192219
- run: echo "All platforms built successfully"

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ endif()
116116

117117
# add executable
118118
add_executable(${TARGET} "src/cli.cpp")
119-
target_compile_features(${TARGET} PRIVATE cxx_std_20)
119+
set_property(TARGET ${TARGET} PROPERTY CXX_STANDARD ${CMAKE_CXX_STANDARD})
120120

121121
# debug/release flags (MULTI-CONFIG SAFE)
122122
# Apply flags per-config using generator expressions

0 commit comments

Comments
 (0)