Commit c356ec8702dd4ee8c49520e8c7960a07c33faf86
Committed by
Henry Schreiner
1 parent
efbdd604
Adding CMake 3.4 check, 2x faster CUDA build
Showing
2 changed files
with
31 additions
and
15 deletions
.github/workflows/tests.yml
| ... | ... | @@ -28,14 +28,29 @@ jobs: |
| 28 | 28 | runs-on: ubuntu-latest |
| 29 | 29 | container: nvidia/cuda:10.2-devel-ubuntu18.04 |
| 30 | 30 | steps: |
| 31 | - - uses: actions/checkout@v1 | |
| 32 | - with: | |
| 33 | - submodules: true | |
| 34 | - - name: Add wget | |
| 35 | - run: apt-get update && apt-get install -y wget | |
| 36 | - - name: Install Modern CMake | |
| 37 | - run: wget -qO- "https://cmake.org/files/v3.16/cmake-3.16.0-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local | |
| 38 | - - name: Configure | |
| 39 | - run: cmake -S . -B build -DCLI11_CUDA_TESTS=ON | |
| 40 | - - name: Build | |
| 41 | - run: cmake --build build | |
| 31 | + - uses: actions/checkout@v1 | |
| 32 | + with: | |
| 33 | + submodules: true | |
| 34 | + - name: Add wget | |
| 35 | + run: apt-get update && apt-get install -y wget | |
| 36 | + - name: Install Modern CMake | |
| 37 | + run: wget -qO- "https://cmake.org/files/v3.16/cmake-3.16.0-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local | |
| 38 | + - name: Configure | |
| 39 | + run: cmake -S . -B build -DCLI11_CUDA_TESTS=ON | |
| 40 | + - name: Build | |
| 41 | + run: cmake --build build -j2 | |
| 42 | + | |
| 43 | + cmake34: | |
| 44 | + name: CMake 3.4 | |
| 45 | + runs-on: ubuntu-latest | |
| 46 | + # container: ubuntu:latest | |
| 47 | + steps: | |
| 48 | + - uses: actions/checkout@v1 | |
| 49 | + with: | |
| 50 | + submodules: true | |
| 51 | + - name: Add CMake folder to path | |
| 52 | + run: mkdir -p cmake && echo "::add-path::$PWD/cmake/bin" | |
| 53 | + - name: Install Modern CMake | |
| 54 | + run: wget -qO- "https://cmake.org/files/v3.4/cmake-3.4.3-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C $PWD/cmake | |
| 55 | + - name: Configure | |
| 56 | + run: cmake --version && mkdir -p build && cd build && cmake .. | ... | ... |
CMakeLists.txt
| ... | ... | @@ -2,13 +2,14 @@ cmake_minimum_required(VERSION 3.4) |
| 2 | 2 | # Note: this is a header only library. If you have an older CMake than 3.4, |
| 3 | 3 | # just add the CLI11/include directory and that's all you need to do. |
| 4 | 4 | |
| 5 | -# Make sure users don't get warnings on a tested (3.4 to 3.14) version | |
| 5 | +# Make sure users don't get warnings on a tested (3.4 to 3.16) version | |
| 6 | 6 | # of CMake. For most of the policies, the new version is better (hence the change). |
| 7 | -# We don't use the 3.4...3.14 syntax because of a bug in a version of MSVC | |
| 8 | -if(${CMAKE_VERSION} VERSION_LESS 3.14) | |
| 7 | +# We don't use the 3.4...3.16 syntax because of a bug in an older MSVC's | |
| 8 | +# built-in and modified CMake 3.11 | |
| 9 | +if(${CMAKE_VERSION} VERSION_LESS 3.16) | |
| 9 | 10 | cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) |
| 10 | 11 | else() |
| 11 | - cmake_policy(VERSION 3.14) | |
| 12 | + cmake_policy(VERSION 3.16) | |
| 12 | 13 | endif() |
| 13 | 14 | |
| 14 | 15 | set(VERSION_REGEX "#define CLI11_VERSION[ \t]+\"(.+)\"") | ... | ... |