From 41943cdb7e4901e36a445609e134cc0f0b02722c Mon Sep 17 00:00:00 2001 From: friendlyanon Date: Mon, 25 Mar 2024 21:12:29 +0100 Subject: [PATCH] Use `Release` with multi-config generators in CI Using just one configuration will marginally speed things up, since try_*() commands have to build artifacts for all the selected configurations, the build system has to be generated for multiple configurations and the build system has to process more configurations when building. --- cmake-init/templates/common/CMakePresets.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cmake-init/templates/common/CMakePresets.json b/cmake-init/templates/common/CMakePresets.json index 6526700..6cff6a4 100644 --- a/cmake-init/templates/common/CMakePresets.json +++ b/cmake-init/templates/common/CMakePresets.json @@ -171,9 +171,17 @@ "binaryDir": "${sourceDir}/build", "hidden": true }, + { + "name": "ci-multi-config", + "description": "Speed up multi-config generators by generating only one configuration instead of the defaults", + "hidden": true, + "cacheVariables": { + "CMAKE_CONFIGURATION_TYPES": "Release" + } + }, { "name": "ci-macos", - "inherits": ["ci-build", "ci-darwin", "dev-mode"{% if pm %}, "{= pm_name =}"{% end %}] + "inherits": ["ci-build", "ci-darwin", "dev-mode", "ci-multi-config"{% if pm %}, "{= pm_name =}"{% end %}] }, { "name": "ci-ubuntu", @@ -181,7 +189,7 @@ }, { "name": "ci-windows", - "inherits": ["ci-build", "ci-win64", "dev-mode"{% if pm %}, "{= pm_name =}"{% if vcpkg %}, "vcpkg-win64-static"{% end %}{% end %}] + "inherits": ["ci-build", "ci-win64", "dev-mode", "ci-multi-config"{% if pm %}, "{= pm_name =}"{% if vcpkg %}, "vcpkg-win64-static"{% end %}{% end %}] } ] }