If you didn’t see – last year we introduced support in SonarQube Server for a feature called C/C++ AutoConfig! Removing the question of wrapping the build altogether.
This is available in SonarQube Server v10.6+, although you should really target at least v2025.1.