cmake: Update presets to use provided build types and not hardcode compiler flags.

The hardcoded compiler flags meant some of these were broken on MSVC.
This commit is contained in:
Ryan Pavlik 2022-06-28 13:37:56 -05:00 committed by Jakob Bornecrantz
parent 0ff4104b38
commit 3689eca3ce

View file

@ -1,81 +1,107 @@
{ {
"version": 2, "version": 3,
"cmakeMinimumRequired": { "cmakeMinimumRequired": {
"major": 3, "major": 3,
"minor": 20, "minor": 21,
"patch": 0 "patch": 0
},
"configurePresets": [
{
"name": "default",
"inherits": "service-debug",
"displayName": "Default (same as service-debug)"
}, },
{ "configurePresets": [
"name": "service-debug", {
"displayName": "Debug Monado service", "name": "default",
"generator": "Ninja", "inherits": "service-debug",
"binaryDir": "${sourceDir}/build", "displayName": "Default (same as service-debug)"
"cacheVariables": { },
"CMAKE_BUILD_TYPE": "Debug", {
"BUILD_DOC": "OFF", "name": ".base-ninja",
"SANITIZE_ADDRESS": "ON", "generator": "Ninja",
"SANITIZE_UNDEFINED": "ON" "hidden": true,
} "binaryDir": "${sourceDir}/build"
}, },
{ {
"name": "standalone-debug", "name": "service-debug",
"inherits": "service-debug", "displayName": "Debug service",
"displayName": "Debug Monado standalone", "inherits": ".base-ninja",
"cacheVariables": { "cacheVariables": {
"XRT_FEATURE_SERVICE": "OFF" "CMAKE_BUILD_TYPE": "Debug",
} "XRT_FEATURE_SERVICE": "ON"
}, },
{ "condition": {
"name": "service-release", "lhs": "${hostSystemName}",
"displayName": "Release Monado service", "type": "notEquals",
"inherits": "service-debug", "rhs": "Windows"
"cacheVariables": { }
"CMAKE_BUILD_TYPE": "Release", },
"BUILD_DOC": "ON", {
"BUILD_DOC_EXTRACT_ALL": "ON", "name": "service-debug-asan",
"SANITIZE_ADDRESS": "OFF", "displayName": "Debug service with sanitizers",
"SANITIZE_UNDEFINED": "OFF" "inherits": "service-debug",
} "cacheVariables": {
}, "SANITIZE_ADDRESS": "ON",
{ "SANITIZE_UNDEFINED": "ON"
"name": "standalone-release", }
"displayName": "Release Monado standalone", },
"inherits": "service-release", {
"cacheVariables": { "name": "inproc-debug",
"XRT_FEATURE_SERVICE": "OFF" "displayName": "Debug in-process",
} "inherits": ".base-ninja",
}, "cacheVariables": {
{ "CMAKE_BUILD_TYPE": "Debug",
"name": "service-debug-optimized", "XRT_FEATURE_SERVICE": "OFF"
"displayName": "Debug Monado service with optimizations", }
"inherits": "service-debug", },
"cacheVariables": { {
"CMAKE_CXX_FLAGS": "-g -march=native -O3 -fno-omit-frame-pointer", "name": "service-release",
"CMAKE_C_FLAGS": "-g -march=native -O3 -fno-omit-frame-pointer", "displayName": "Release service",
"SANITIZE_UNDEFINED": "OFF" "inherits": "service-debug",
} "cacheVariables": {
}, "CMAKE_BUILD_TYPE": "Release",
{ "BUILD_DOC": "ON",
"name": "standalone-debug-optimized", "BUILD_DOC_EXTRACT_ALL": "ON"
"displayName": "Debug Monado standalone with optimizations", },
"inherits": "service-debug-optimized", "condition": {
"cacheVariables": { "lhs": "${hostSystemName}",
"XRT_FEATURE_SERVICE": "OFF" "type": "notEquals",
} "rhs": "Windows"
} }
], },
"buildPresets": [ {
{ "name": "inproc-release",
"name": "default", "displayName": "Release in-process",
"displayName": "Build and install", "inherits": "inproc-debug",
"configurePreset": "default", "cacheVariables": {
"targets": "install" "CMAKE_BUILD_TYPE": "Release",
} "BUILD_DOC": "ON",
] "BUILD_DOC_EXTRACT_ALL": "ON"
}
},
{
"name": "service-relwithdebinfo",
"displayName": "RelWithDebInfo service",
"inherits": "service-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
},
"condition": {
"lhs": "${hostSystemName}",
"type": "notEquals",
"rhs": "Windows"
}
},
{
"name": "inproc-relwithdebinfo",
"displayName": "RelWithDebInfo in-process",
"inherits": "inproc-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
}
],
"buildPresets": [
{
"name": "default",
"displayName": "Build and install",
"configurePreset": "default",
"targets": "install"
}
]
} }