Run cmake-init and setup flake.nix and default.nix
This commit is contained in:
153
CMakePresets.json
Normal file
153
CMakePresets.json
Normal file
@@ -0,0 +1,153 @@
|
||||
{
|
||||
"version": 2,
|
||||
"cmakeMinimumRequired": {
|
||||
"major": 3,
|
||||
"minor": 14,
|
||||
"patch": 0
|
||||
},
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "cmake-pedantic",
|
||||
"hidden": true,
|
||||
"warnings": {
|
||||
"dev": true,
|
||||
"deprecated": true,
|
||||
"uninitialized": true,
|
||||
"unusedCli": true,
|
||||
"systemVars": false
|
||||
},
|
||||
"errors": {
|
||||
"dev": true,
|
||||
"deprecated": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "dev-mode",
|
||||
"hidden": true,
|
||||
"inherits": "cmake-pedantic",
|
||||
"cacheVariables": {
|
||||
"ec-controller_DEVELOPER_MODE": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "cppcheck",
|
||||
"hidden": true,
|
||||
"cacheVariables": {
|
||||
"CMAKE_CXX_CPPCHECK": "cppcheck;--inline-suppr"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "clang-tidy",
|
||||
"hidden": true,
|
||||
"cacheVariables": {
|
||||
"CMAKE_CXX_CLANG_TIDY": "clang-tidy;--header-filter=^${sourceDir}/"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci-std",
|
||||
"description": "This preset makes sure the project actually builds with at least the specified standard",
|
||||
"hidden": true,
|
||||
"cacheVariables": {
|
||||
"CMAKE_CXX_EXTENSIONS": "OFF",
|
||||
"CMAKE_CXX_STANDARD": "20",
|
||||
"CMAKE_CXX_STANDARD_REQUIRED": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "flags-linux",
|
||||
"hidden": true,
|
||||
"cacheVariables": {
|
||||
"CMAKE_CXX_FLAGS": "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -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",
|
||||
"CMAKE_EXE_LINKER_FLAGS": "-Wl,--allow-shlib-undefined,--as-needed,-z,noexecstack,-z,relro,-z,now",
|
||||
"CMAKE_SHARED_LINKER_FLAGS": "-Wl,--allow-shlib-undefined,--as-needed,-z,noexecstack,-z,relro,-z,now"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "flags-darwin",
|
||||
"hidden": true,
|
||||
"cacheVariables": {
|
||||
"CMAKE_CXX_FLAGS": "-fstack-protector-strong -fcf-protection=full -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"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "flags-windows",
|
||||
"description": "Note that all the flags after /W4 are required for MSVC to conform to the language standard",
|
||||
"hidden": true,
|
||||
"cacheVariables": {
|
||||
"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",
|
||||
"CMAKE_EXE_LINKER_FLAGS": "/machine:x64 /guard:cf"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci-linux",
|
||||
"generator": "Unix Makefiles",
|
||||
"hidden": true,
|
||||
"inherits": ["flags-linux", "ci-std"],
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci-darwin",
|
||||
"generator": "Unix Makefiles",
|
||||
"hidden": true,
|
||||
"inherits": ["flags-darwin", "ci-std"],
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci-win64",
|
||||
"inherits": ["flags-windows", "ci-std"],
|
||||
"generator": "Visual Studio 17 2022",
|
||||
"architecture": "x64",
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "coverage-linux",
|
||||
"binaryDir": "${sourceDir}/build/coverage",
|
||||
"inherits": "ci-linux",
|
||||
"hidden": true,
|
||||
"cacheVariables": {
|
||||
"ENABLE_COVERAGE": "ON",
|
||||
"CMAKE_BUILD_TYPE": "Coverage",
|
||||
"CMAKE_CXX_FLAGS_COVERAGE": "-Og -g --coverage -fkeep-inline-functions -fkeep-static-functions",
|
||||
"CMAKE_EXE_LINKER_FLAGS_COVERAGE": "--coverage",
|
||||
"CMAKE_SHARED_LINKER_FLAGS_COVERAGE": "--coverage"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci-coverage",
|
||||
"inherits": ["coverage-linux", "dev-mode"],
|
||||
"cacheVariables": {
|
||||
"COVERAGE_HTML_COMMAND": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci-sanitize",
|
||||
"binaryDir": "${sourceDir}/build/sanitize",
|
||||
"inherits": ["ci-linux", "dev-mode"],
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Sanitize",
|
||||
"CMAKE_CXX_FLAGS_SANITIZE": "-O2 -g -fsanitize=address,undefined -fno-omit-frame-pointer -fno-common"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci-build",
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "ci-macos",
|
||||
"inherits": ["ci-build", "ci-darwin", "dev-mode"]
|
||||
},
|
||||
{
|
||||
"name": "ci-ubuntu",
|
||||
"inherits": ["ci-build", "ci-linux", "clang-tidy", "cppcheck", "dev-mode"]
|
||||
},
|
||||
{
|
||||
"name": "ci-windows",
|
||||
"inherits": ["ci-build", "ci-win64", "dev-mode"]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user