We use some old C/C++ compilers from Metrowerks and Microtek that are not supported by the build wrapper, so I want to set up a compilation database.
The Clang documentation of the compilation database explains the format, but there is no explanation which options are recognized in the command and arguments values. I cannot find this information in the Sonarqube documentation, too.
My guess is that -I and -D are recognized for include paths and defines.
But I am not sure about the following:
Is the command itself (the first element in command or arguments) used for any purpose? Is there any assumption about compiler defined macros (like clang or clang_ver).
I have similar macros for the compilers we use. Can I just add them with -D to the command or arguments?
Is the CLANG -isystem (system include path) option recognized and has any effect?
We have SonarQube 9.4 (Enterprise) in production, and 9.9 in test
Deployment: Other people care
We use some old C/C++ compilers from Metrowerks and Microtek that are not supported by the build wrapper, so I want to set up a compilation database.
What I achieved so far: I found that there is no indication in the result views whether a source file has been analyzed (for c/c++) at all.
We got this warning:
“There are problems with file encoding in the source code. Please check the scanner logs for more details.” Does this block analysis?
those compilers are not supported at all, independently from build-wrapper or compilation database.
The compilation database is just a format to represent the build commands.
Yes, there is no contract on how the tooling should use the compilation commands.
Yes, it is used and it is essential, it is used to detect the compiler kind from its name. Also it is used to probe the compiler to detect system includes and default predefined macros.
I would not recommend you to invest into this strategy unless the compilers you are trying to use are based on GCC/Clang, or if they don’t appear on the list of supported compilers.
Could you be more precise about the compilers you would like to have support for?