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