CMakePresets.json (5478B)
1 { 2 "version": 2, 3 "cmakeMinimumRequired": { 4 "major": 3, 5 "minor": 14, 6 "patch": 0 7 }, 8 "configurePresets": [ 9 { 10 "name": "cmake-pedantic", 11 "hidden": true, 12 "warnings": { 13 "dev": true, 14 "deprecated": true, 15 "uninitialized": true, 16 "unusedCli": true, 17 "systemVars": false 18 }, 19 "errors": { 20 "dev": true, 21 "deprecated": true 22 } 23 }, 24 { 25 "name": "dev-mode", 26 "hidden": true, 27 "inherits": "cmake-pedantic", 28 "cacheVariables": { 29 "hemplate_DEVELOPER_MODE": "ON" 30 } 31 }, 32 { 33 "name": "cppcheck", 34 "hidden": true, 35 "cacheVariables": { 36 "CMAKE_CXX_CPPCHECK": "cppcheck;--inline-suppr" 37 } 38 }, 39 { 40 "name": "clang-tidy", 41 "hidden": true, 42 "cacheVariables": { 43 "CMAKE_CXX_CLANG_TIDY": "clang-tidy;--header-filter=^${sourceDir}/" 44 } 45 }, 46 { 47 "name": "ci-std", 48 "description": "This preset makes sure the project actually builds with at least the specified standard", 49 "hidden": true, 50 "cacheVariables": { 51 "CMAKE_CXX_EXTENSIONS": "OFF", 52 "CMAKE_CXX_STANDARD": "20", 53 "CMAKE_CXX_STANDARD_REQUIRED": "ON" 54 } 55 }, 56 { 57 "name": "flags-gcc-clang", 58 "description": "These flags are supported by both GCC and Clang", 59 "hidden": true, 60 "cacheVariables": { 61 "CMAKE_CXX_FLAGS": "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS=1 -fstack-protector-strong -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough -Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast", 62 "CMAKE_EXE_LINKER_FLAGS": "-Wl,--allow-shlib-undefined,--as-needed,-z,noexecstack,-z,relro,-z,now,-z,nodlopen", 63 "CMAKE_SHARED_LINKER_FLAGS": "-Wl,--allow-shlib-undefined,--as-needed,-z,noexecstack,-z,relro,-z,now,-z,nodlopen" 64 } 65 }, 66 { 67 "name": "flags-appleclang", 68 "hidden": true, 69 "cacheVariables": { 70 "CMAKE_CXX_FLAGS": "-fstack-protector-strong -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough -Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast" 71 } 72 }, 73 { 74 "name": "flags-msvc", 75 "description": "Note that all the flags after /W4 are required for MSVC to conform to the language standard", 76 "hidden": true, 77 "cacheVariables": { 78 "CMAKE_CXX_FLAGS": "/sdl /guard:cf /utf-8 /diagnostics:caret /w14165 /w44242 /w44254 /w44263 /w34265 /w34287 /w44296 /w44365 /w44388 /w44464 /w14545 /w14546 /w14547 /w14549 /w14555 /w34619 /w34640 /w24826 /w14905 /w14906 /w14928 /w45038 /W4 /permissive- /volatile:iso /Zc:inline /Zc:preprocessor /Zc:enumTypes /Zc:lambda /Zc:__cplusplus /Zc:externConstexpr /Zc:throwingNew /EHsc", 79 "CMAKE_EXE_LINKER_FLAGS": "/machine:x64 /guard:cf", 80 "CMAKE_SHARED_LINKER_FLAGS": "/machine:x64 /guard:cf" 81 } 82 }, 83 { 84 "name": "ci-linux", 85 "inherits": ["flags-gcc-clang", "ci-std"], 86 "generator": "Unix Makefiles", 87 "hidden": true, 88 "cacheVariables": { 89 "CMAKE_BUILD_TYPE": "Release" 90 } 91 }, 92 { 93 "name": "ci-darwin", 94 "inherits": ["flags-appleclang", "ci-std"], 95 "generator": "Xcode", 96 "hidden": true 97 }, 98 { 99 "name": "ci-win64", 100 "inherits": ["flags-msvc", "ci-std"], 101 "generator": "Visual Studio 17 2022", 102 "architecture": "x64", 103 "hidden": true 104 }, 105 { 106 "name": "coverage-linux", 107 "binaryDir": "${sourceDir}/build/coverage", 108 "inherits": "ci-linux", 109 "hidden": true, 110 "cacheVariables": { 111 "ENABLE_COVERAGE": "ON", 112 "CMAKE_BUILD_TYPE": "Coverage", 113 "CMAKE_CXX_FLAGS_COVERAGE": "-Og -g --coverage -fkeep-inline-functions -fkeep-static-functions", 114 "CMAKE_EXE_LINKER_FLAGS_COVERAGE": "--coverage", 115 "CMAKE_SHARED_LINKER_FLAGS_COVERAGE": "--coverage" 116 } 117 }, 118 { 119 "name": "ci-coverage", 120 "inherits": ["coverage-linux", "dev-mode"], 121 "cacheVariables": { 122 "COVERAGE_HTML_COMMAND": "" 123 } 124 }, 125 { 126 "name": "ci-sanitize", 127 "binaryDir": "${sourceDir}/build/sanitize", 128 "inherits": ["ci-linux", "dev-mode"], 129 "cacheVariables": { 130 "CMAKE_BUILD_TYPE": "Sanitize", 131 "CMAKE_CXX_FLAGS_SANITIZE": "-U_FORTIFY_SOURCE -O2 -g -fsanitize=address,undefined -fno-omit-frame-pointer -fno-common" 132 } 133 }, 134 { 135 "name": "ci-build", 136 "binaryDir": "${sourceDir}/build", 137 "hidden": true 138 }, 139 { 140 "name": "ci-multi-config", 141 "description": "Speed up multi-config generators by generating only one configuration instead of the defaults", 142 "hidden": true, 143 "cacheVariables": { 144 "CMAKE_CONFIGURATION_TYPES": "Release" 145 } 146 }, 147 { 148 "name": "ci-macos", 149 "inherits": ["ci-build", "ci-darwin", "dev-mode", "ci-multi-config"] 150 }, 151 { 152 "name": "ci-ubuntu", 153 "inherits": ["ci-build", "ci-linux", "clang-tidy", "cppcheck", "dev-mode"] 154 }, 155 { 156 "name": "ci-windows", 157 "inherits": ["ci-build", "ci-win64", "dev-mode", "ci-multi-config"] 158 } 159 ] 160 }