mirror of
https://github.com/CLIUtils/CLI11.git
synced 2026-01-19 04:52:08 +00:00
chore: add CMake presets (#1181)
Add two presets (default and tidy). --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
24
.github/workflows/tests.yml
vendored
24
.github/workflows/tests.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
std: ["14", "17", "20","23"]
|
std: ["14", "17", "20", "23"]
|
||||||
precompile: ["ON", "OFF"]
|
precompile: ["ON", "OFF"]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -61,6 +61,16 @@ jobs:
|
|||||||
files: build/coverage.info
|
files: build/coverage.info
|
||||||
functionalities: fixes
|
functionalities: fixes
|
||||||
|
|
||||||
|
preset:
|
||||||
|
name: Preset
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run CMake Workflow
|
||||||
|
run: cmake --workflow default
|
||||||
|
|
||||||
|
|
||||||
catch2-3:
|
catch2-3:
|
||||||
name: Catch 2 3.x
|
name: Catch 2 3.x
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
@@ -92,14 +102,14 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install requirements
|
||||||
|
run: apt-get update && apt-get install -y ninja-build
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: >
|
run: cmake --preset tidy
|
||||||
cmake -S . -B build -DCMAKE_CXX_STANDARD=20
|
|
||||||
-DCMAKE_CXX_CLANG_TIDY="$(which
|
|
||||||
clang-tidy);--use-color;--warnings-as-errors=*"
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cmake --build build -j4 -- --keep-going
|
run: cmake --build --preset tidy
|
||||||
|
|
||||||
cuda11-build:
|
cuda11-build:
|
||||||
name: CUDA 11 build only
|
name: CUDA 11 build only
|
||||||
@@ -396,7 +406,7 @@ jobs:
|
|||||||
cmake-version: "3.31"
|
cmake-version: "3.31"
|
||||||
args: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON
|
args: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON
|
||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
|
|
||||||
- name: Check CMake 4.0
|
- name: Check CMake 4.0
|
||||||
uses: ./.github/actions/quick_cmake
|
uses: ./.github/actions/quick_cmake
|
||||||
with:
|
with:
|
||||||
|
|||||||
65
CMakePresets.json
Normal file
65
CMakePresets.json
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"configurePresets": [
|
||||||
|
{
|
||||||
|
"name": "default",
|
||||||
|
"displayName": "Default",
|
||||||
|
"binaryDir": "build",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"errors": {
|
||||||
|
"dev": true,
|
||||||
|
"deprecated": true
|
||||||
|
},
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Debug",
|
||||||
|
"CMAKE_EXPORT_COMPILE_COMMANDS": true,
|
||||||
|
"CLI11_WARNINGS_AS_ERRORS": true,
|
||||||
|
"CMAKE_COLOR_DIAGNOSTICS": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "tidy",
|
||||||
|
"displayName": "Clang-tidy",
|
||||||
|
"inherits": "default",
|
||||||
|
"binaryDir": "build-tidy",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_CXX_CLANG_TIDY": "clang-tidy;--use-color;--warnings-as-errors=*",
|
||||||
|
"CMAKE_CXX_STANDARD": "17"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"buildPresets": [
|
||||||
|
{
|
||||||
|
"name": "default",
|
||||||
|
"displayName": "Default Build",
|
||||||
|
"configurePreset": "default"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "tidy",
|
||||||
|
"displayName": "Clang-tidy Build",
|
||||||
|
"configurePreset": "tidy",
|
||||||
|
"nativeToolOptions": ["-k0"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testPresets": [
|
||||||
|
{
|
||||||
|
"name": "default",
|
||||||
|
"displayName": "Default",
|
||||||
|
"configurePreset": "default",
|
||||||
|
"output": {
|
||||||
|
"outputOnFailure": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"workflowPresets": [
|
||||||
|
{
|
||||||
|
"name": "default",
|
||||||
|
"displayName": "Default Workflow",
|
||||||
|
"steps": [
|
||||||
|
{ "type": "configure", "name": "default" },
|
||||||
|
{ "type": "build", "name": "default" },
|
||||||
|
{ "type": "test", "name": "default" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user