-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sonar.cxx.jsonCompilationDatabase not working? #1304
Comments
@sweetim I'm not really familiar with this feature. Maybe you can turn debug info on to get more help (https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Get-debug-information). As far as I know the -I parameters are used to |
Yes, it is related to it, anyway to fix it? I try to include those directories with |
@sweetim https://github.com/SonarOpenCommunity/sonar-cxx/blob/master/cxx-sensors/src/test/resources/org/sonar/cxx/sensors/json-compilation-database-project/compile_commands.json check that file for the format of that should be expected.
is a system header so you will need to use
in start of the db to pass the system directories |
@vesajaaskelainen is this |
@guwirth extension to JSON compilation database only used(?) in cxx plugin. This is a workaround as cxx plugin does not use "compilation process" for header analysis so that it could capture different definition/include sets when analyzing headers. Now this global definition is used for more or less for all headers. |
@vesajaaskelainen thanks for your answer. We already discussed here in the past a solution to set system include files and local include files with different configuration properties. One solution could be to define one more property beside |
What we do with Klocwork is to use it capture build process as it scans for both user provided command line options (what is now in JSON compilation database example above) and also compiler internal defines and includes. Latter is needed to get proper analysis done, usually in command line there isn't many settings (at least in our cases). When we have those settings then we will utilize other extension that uses defines and includes instead of command line part. With this information we get decent analysis from cxx-plugin. What we do for We is problem still in out system is that it does not differentiate with system vs. user includes they are just combined in defines/includes fields. Problem with Also another problem with if one would make |
I am currently using Sonar cxx v0.9.8
I found that the
sonar.cxx.jsonCompilationDatabase
config is not working?When i run the
sonar-scanner
it still complains aboutcannot find the sources for '#include <iostream>
The compile_commands.json file
May I know do I still need to configure the
sonar.cxx.includeDirectories
or thejsonCompilationDatabase
should handle all these automatically?The text was updated successfully, but these errors were encountered: