1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-05 22:53:52 +00:00

Adding CMake 3.4 check, 2x faster CUDA build

This commit is contained in:
Henry Schreiner 2020-01-08 10:27:56 -05:00 committed by Henry Schreiner
parent efbdd604af
commit c356ec8702
2 changed files with 31 additions and 15 deletions

View File

@ -28,14 +28,29 @@ jobs:
runs-on: ubuntu-latest
container: nvidia/cuda:10.2-devel-ubuntu18.04
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Add wget
run: apt-get update && apt-get install -y wget
- name: Install Modern CMake
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
- name: Configure
run: cmake -S . -B build -DCLI11_CUDA_TESTS=ON
- name: Build
run: cmake --build build
- uses: actions/checkout@v1
with:
submodules: true
- name: Add wget
run: apt-get update && apt-get install -y wget
- name: Install Modern CMake
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
- name: Configure
run: cmake -S . -B build -DCLI11_CUDA_TESTS=ON
- name: Build
run: cmake --build build -j2
cmake34:
name: CMake 3.4
runs-on: ubuntu-latest
# container: ubuntu:latest
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Add CMake folder to path
run: mkdir -p cmake && echo "::add-path::$PWD/cmake/bin"
- name: Install Modern CMake
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
- name: Configure
run: cmake --version && mkdir -p build && cd build && cmake ..

View File

@ -2,13 +2,14 @@ cmake_minimum_required(VERSION 3.4)
# Note: this is a header only library. If you have an older CMake than 3.4,
# just add the CLI11/include directory and that's all you need to do.
# Make sure users don't get warnings on a tested (3.4 to 3.14) version
# Make sure users don't get warnings on a tested (3.4 to 3.16) version
# of CMake. For most of the policies, the new version is better (hence the change).
# We don't use the 3.4...3.14 syntax because of a bug in a version of MSVC
if(${CMAKE_VERSION} VERSION_LESS 3.14)
# We don't use the 3.4...3.16 syntax because of a bug in an older MSVC's
# built-in and modified CMake 3.11
if(${CMAKE_VERSION} VERSION_LESS 3.16)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
else()
cmake_policy(VERSION 3.14)
cmake_policy(VERSION 3.16)
endif()
set(VERSION_REGEX "#define CLI11_VERSION[ \t]+\"(.+)\"")