I have two configure presets in my CMakePresets.json were I would like to merge the flags of the inherit configurePresets (gcc) with the other preset (gcc-arm-embedded)
Here is a simplified version:
"configurePresets": [
{
"name": "gcc",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_FLAGS": "-Wall -Wextra",
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "gcc-arm-embedded",
"hidden": true,
"inherits": ["gcc"],
"cacheVariables": {
"CMAKE_CXX_FLAGS": "-ffunction-sections -fdata-sections",
"CMAKE_EXE_LINKER_FLAGS": "-mcpu=cortex-m7 -mthumb",
"CMAKE_BUILD_TYPE": "MinSizeRel"
}
},
{
"name": "embedded",
"inherits": ["gcc", "gcc-arm-embedded"]
}
]
The problem is, if I use the presets embedded
the resulting CMAKE flags are:
CMAKE_CXX_FLAGS: "-Wall -Wextra"
CMAKE_EXE_LINKER_FLAGS: "-mcpu=cortex-m7 -mthumb",
CMAKE_BUILD_TYPE: "Release"
My goal is this:
CMAKE_CXX_FLAGS: "-Wall -Wextra -ffunction-sections -fdata-sections"
CMAKE_EXE_LINKER_FLAGS: "-mcpu=cortex-m7 -mthumb",
CMAKE_BUILD_TYPE: "MinSizeRel"
Is this somehow possible with CMakePresets?