Commit fbe1763675cfe0f21c20aa95b658dc94bde6b8ac

Authored by Philip Top
Committed by GitHub
1 parent 0f040f78

add new CMAKE version support and fix CI test failure (#823)

.github/workflows/tests.yml
... ... @@ -236,16 +236,28 @@ jobs:
236 236 cmake-version: "3.20"
237 237 if: success() || failure()
238 238  
239   - - name: Check CMake 3.21 (full)
  239 + - name: Check CMake 3.21
240 240 uses: ./.github/actions/quick_cmake
241 241 with:
242 242 cmake-version: "3.21"
243   - args: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON
244 243 if: success() || failure()
245 244  
246   - - name: Check CMake 3.22 (full)
  245 + - name: Check CMake 3.22
247 246 uses: ./.github/actions/quick_cmake
248 247 with:
249 248 cmake-version: "3.22"
  249 + if: success() || failure()
  250 +
  251 + - name: Check CMake 3.23 (full)
  252 + uses: ./.github/actions/quick_cmake
  253 + with:
  254 + cmake-version: "3.23"
  255 + args: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON
  256 + if: success() || failure()
  257 +
  258 + - name: Check CMake 3.24 (full)
  259 + uses: ./.github/actions/quick_cmake
  260 + with:
  261 + cmake-version: "3.24"
250 262 args: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON
251 263 if: success() || failure()
... ...
CMakeLists.txt
... ... @@ -6,10 +6,10 @@ cmake_minimum_required(VERSION 3.4)
6 6 # of CMake. For most of the policies, the new version is better (hence the change).
7 7 # We don't use the 3.4...3.21 syntax because of a bug in an older MSVC's
8 8 # built-in and modified CMake 3.11
9   -if(${CMAKE_VERSION} VERSION_LESS 3.22)
  9 +if(${CMAKE_VERSION} VERSION_LESS 3.24)
10 10 cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
11 11 else()
12   - cmake_policy(VERSION 3.22)
  12 + cmake_policy(VERSION 3.24)
13 13 endif()
14 14  
15 15 set(VERSION_REGEX "#define CLI11_VERSION[ \t]+\"(.+)\"")
... ...
tests/CMakeLists.txt
... ... @@ -4,7 +4,7 @@ if(CLI11_SANITIZERS)
4 4 sanitizers
5 5 GIT_REPOSITORY https://github.com/arsenm/sanitizers-cmake.git
6 6 GIT_SHALLOW 1
7   - GIT_TAG 99e159e)
  7 + GIT_TAG a6748f4)
8 8  
9 9 FetchContent_GetProperties(sanitizers)
10 10  
... ...