Getting segger compilations to work

Hi,

We are using the shiny new sonarqube 2025.1 version, but when trying to build with Segger embedded studio, see things like:

INFO Ignore unknown compiler: C:\PROGRA~1\SEGGER\SEGGER~1.18\bin\CC-SEG~1.EXE -DCOMPONENT_MAJOR_VERSION=999 -DCOMPONENT_MINOR_VERSION=999 -DCOMPONENT_PATCH_VERSION=999 -DSEGGER_EMBEDDED_STUDIO … -IC:\PROGRA~1\SEGGER\SEGGER~1.18\source\libcxx\include

ERROR Error during SonarScanner Engine execution
java.lang.IllegalStateException: The Compilation Database JSON file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:

  • you are correctly invoking the scanner with correct configuration
  • your compiler is supported
  • you are providing the path to the correct Compilation Database JSON
  • you are building and analyzing the same source checkout, absolute paths must be identical in build and analysis steps
    at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:314)
    at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:190)

It looks like Segger is not officially supported, however sonarqube does support clang. Does anyone have any advice on how best to “teach” sonarqube to recognize it as a clang variant?

Hey there.

Indeed, Segger is not supported. CPP-2060

However, you should be able to take advantage of SonarQube v2025.1 LTA’s C/C++ AutoConfig, which adds support for analyzing code compiled by compilers that don’t work the build wrapper / Compilation Database mode.

1 Like