From 664f2749e688e2aa2b322d2296111e1246a860ee Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Sun, 23 Apr 2023 17:12:46 +0200 Subject: [PATCH] build: add "ci" configure preset to reduce verbosity `cmake --preset ci` is equivalent to `cmake -B build -G Ninja -D CI_BUILD=ON` Also remove build presets as they're not very useful without workflow presets, which are only available in schema versions 6 and above. --- .github/workflows/test.yml | 6 ++-- CMakePresets.json | 56 ++++---------------------------------- CONTRIBUTING.md | 2 +- 3 files changed, 10 insertions(+), 54 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c58582157f..2fc6b13ec4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -199,7 +199,7 @@ jobs: - name: Build run: | - cmake -B build -G Ninja -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX ${{ matrix.flags }} -D CI_BUILD=ON + cmake --preset ci -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX ${{ matrix.flags }} cmake --build build - if: "!cancelled()" @@ -305,7 +305,7 @@ jobs: - name: Build run: | - cmake -B build -G Ninja -D CMAKE_BUILD_TYPE='RelWithDebInfo' -D CI_BUILD=ON + cmake --preset ci -D CMAKE_BUILD_TYPE='RelWithDebInfo' cmake --build build - name: Install test deps @@ -395,5 +395,5 @@ jobs: - name: Build run: | - cmake -B build -G Ninja -D CI_BUILD=ON + cmake --preset ci cmake --build build diff --git a/CMakePresets.json b/CMakePresets.json index 22077a64a5..1d214d7801 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -34,65 +34,21 @@ }, "inherits": ["base"] }, - { - "name": "windows-default", - "displayName": "Windows x64 RelWithDebInfo", - "description": "Sets Ninja generator, enables optimizations with debug information for x64", - "generator": "Ninja", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "RelWithDebInfo" - }, - "architecture": { - "value": "x64", - "strategy": "external" - }, - "vendor": { - "microsoft.com/VisualStudioSettings/CMake/1.0": { - "hostOS": ["Windows"] - } - }, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - }, - "inherits": ["base"] - }, { "name": "iwyu", "displayName": "IWYU", - "description": "Run include-what-you-use with the compiler", + "description": "Run include-what-you-use", "cacheVariables": { "ENABLE_IWYU": "ON" }, "inherits": ["base"] - } - ], - "buildPresets": [ - { - "name": "default", - "configurePreset": "default" }, { - "name": "debug", - "configurePreset": "debug" - }, - { - "name": "release", - "configurePreset": "release" - }, - { - "name": "windows-default", - "configurePreset": "windows-default", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - } - }, - { - "name": "iwyu", - "configurePreset": "iwyu" + "name": "ci", + "cacheVariables": { + "CI_BUILD": "ON" + }, + "inherits": ["base"] } ] } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c73c205183..85dc0fdbfd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -254,7 +254,7 @@ For managing includes in C files, use [include-what-you-use]. - To see which includes needs fixing use the cmake preset `iwyu`: ``` cmake --preset iwyu - cmake --build --preset iwyu + cmake --build build iwyu ``` - There's also a make target that automatically fixes the suggestions from IWYU: