Skip to content

Commit

Permalink
๐Ÿ› ๐Ÿ— Bump build requirements and CI to C++20
Browse files Browse the repository at this point in the history
  • Loading branch information
GHF committed Nov 15, 2023
1 parent 3214237 commit f25ed8d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ jobs:
matrix:
compiler: [ GCC, Clang ]
coverage: [ OFF, ON ]
std: [17, 20]
std: [20, 23]
exclude:
- coverage: ON
include:
- compiler: Clang
version: 15
- compiler: GCC
version: latest
- std: 17
test_with_cxx20: OFF
- std: 20
test_with_cxx20: ON
test_with_cxx23: OFF
- std: 23
test_with_cxx23: ON
- compiler: Clang
std: 20
std: 23
version: 15
test_with_cxx20: ON
test_with_cxx23: ON
coverage: ON

steps:
Expand All @@ -50,7 +50,7 @@ jobs:
cc: 1

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCODE_COVERAGE=${{ matrix.coverage }} -DTEST_WITH_CXX20=${{ matrix.test_with_cxx20 }}
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCODE_COVERAGE=${{ matrix.coverage }} -DTEST_WITH_CXX23=${{ matrix.test_with_cxx23 }}

- name: Build
run: cmake --build ${{github.workspace}}/build --parallel --config ${{env.BUILD_TYPE}}
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ project(mays LANGUAGES CXX)

add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17)
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_20)

# Build unit tests when built standalone
if(TOP_LEVEL_PROJECT)
option(TEST_WITH_CXX20 "Build unit tests under C++20" OFF)
option(TEST_WITH_CXX23 "Build unit tests under C++23" OFF)

option(CODE_COVERAGE "Enable coverage reporting (Clang only)" OFF)
if(CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Clang")
Expand Down Expand Up @@ -43,8 +43,8 @@ if(TOP_LEVEL_PROJECT)
mays
Catch2::Catch2WithMain
)
if(TEST_WITH_CXX20)
target_compile_features(${TEST_NAME} PRIVATE cxx_std_20)
if(TEST_WITH_CXX23)
target_compile_features(${TEST_NAME} PRIVATE cxx_std_23)
endif()
target_compile_options(${TEST_NAME}
PRIVATE
Expand Down

0 comments on commit f25ed8d

Please sign in to comment.