In our project, we would like to create mixins from other mixins.
What that means is: When using main-mixin, we want to use a set of mixins.
This allows for a single mixin to be defining, let's say: The output folders, the toolchain, specific build functions (prod build vs dev build), etc.
Example
Currently, I am making the main-mixin with all the default commands, output directory & co, but changing some arguments by using another mixin before it. For example:
{
"build": {
"legacy": {
"cmake-args": [], // Many things here
"install-base": "/opt/company/workspace/install/legacy",
"build-base": "/opt/company/workspace/build/legacy",
"log-base": "/opt/company/workspace/log/legacy",
},
"thirdparty": {
"install-base": "/opt/company/thirdparty/install/legacy",
"build-base": "/opt/company/thirdparty/build/legacy",
"log-base": "/opt/company/thirdparty/log/legacy",
},
}
}
Would be called as: colcon build --mixin thirdparty legacy.
Prefered solution
{
"build": {
"main": {
"cmake-args": [], // Many things here
"mixin": ["legacy_folder"],
},
"debug": {
"cmake-args": [], // Many things here
"mixin": ["legacy_folder", "asan", "ubsan"],
},
"thirdparty": {
"cmake-args": [], // Many things here
"mixin": ["thirdparty_folder"],
},
"legacy_folder": {
"install-base": "/opt/company/workspace/install/legacy",
"build-base": "/opt/company/workspace/build/legacy",
"log-base": "/opt/company/workspace/log/legacy",
},
"thirdparty_folder": {
"install-base": "/opt/company/thirdparty/install/legacy",
"build-base": "/opt/company/thirdparty/build/legacy",
"log-base": "/opt/company/thirdparty/log/legacy",
},
}
}
Introduction
In our project, we would like to create mixins from other mixins.
What that means is: When using main-mixin, we want to use a set of mixins.
This allows for a single mixin to be defining, let's say: The output folders, the toolchain, specific build functions (prod build vs dev build), etc.
Example
Currently, I am making the main-mixin with all the default commands, output directory & co, but changing some arguments by using another mixin before it. For example:
Would be called as:
colcon build --mixin thirdparty legacy
.Prefered solution