It is necessary to build the project on different hosts (Windows, Linux). Target - bare metal and does not depend on the host.
I made a nested PresetsJson which has 2 subconfigurations with platform-specific settings:
PlatformWindows
PlatformLinux
Then in the main CMakePresets.json I created different configurations.
Example:
{
“name”: “Debug”,
“inherits”: “Platform${hostSystemName}”, or “inherits”: “Platform$env{hostSystemName}”,
“displayName”: “Debug”,
“description”: “Debug”,
}
It does not work
As I understand it, you cannot use env variables in “inherits”?
I also tried creating nested PresetsJson with different names for different platforms:
PlatformWindows.json
PlatformLinux.json
“include”: [
“Platform$env{hostSystemName}.json”,
],
This also doesn’t work.
Is there a way to write basic Presets that can then be used depending on the platform?
PS: there can be many final configurations, I don’t want to multiply their number by the number of hosts.
I use Visual Studio Code