Would it be possible to add this as an improvement to the plugin? Ie, when a visual studio generator is set to the generator property use config instead of CMAKE_BUILD_TYPE or would this be too custom?
I do not think an implementation will be easy, and if so, be of much use.
Remember, users may enter an arbritrary value for the build type (this is because users may define custom build-types in their CMakeLists.txt). Therefore, it is not possible to define a mapping of <custom build type> (in effect with the Makefiles generator on linux) to --config <whatever VS build needs> (in effect with the VS generator on windows) in the plugin. Of course, the plugin could offer a way to define that mapping in its UI to solve the problem. But such an UI would be confusing to users and the pipeline UI is text based; making the cmakeBuild invocation code nearly unreadable if someone uses the snippet generator.
Apart the mapping problem, my other concerns on implementing the improvement are
- It would require to build up a knowledge base that tracks
- which generator needs the CMAKE_BUILD_TYPE variable at script generation time,
- which generator needs an extra option to specify the build-type at build time and what the name of the option is.
- Maintenance effort of that knowledge base (Permanent maintenance is required in case cmake comes with new generators).
Another obstacle: Users may specify an empty value for the generator, leaving the generator choice to cmake, depending on the OS your code is build on. Could be solved by an extra knowledge base that tracks cmake's default generator choice. Until a problem with a future revision of cmake that switches to a different default generator, which again could be solved by a permanently maintained knowledge base.
Chuck Berry: Too much monkey business.
Kevlin Henney: Except for the problem of too many layers of indirection