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