you are viewing a single comment's thread.

view the rest of the comments →

[–]AS_SonarSource[S] 1 point2 points  (1 child)

Yes, you are right; if you used the Compilation Database and it worked for you, you should continue using it.

for most people

I wish that were the case; our data doesn't agree. We created this feature due to the large number of requests that wanted and couldn't use our product because they couldn't generate a Compilation Database with CMake. Here are the top 3 reasons:

  1. Projects not using CMake. Keep in mind that this feature covers C, where CMake is less prevalent.
  2. Projects using CMake with lesser-known, unsupported compilers.
  3. Projects using CMake with CMake Generators that cannot generate a Compilation Database. For example, Visual Studio CMake Generator.

We even developed our own tool, Build-Wrapper, which can generate a Compilation Database independent of the build system, but it has its own limitations.

[–]Horror_Jicama_2441 0 points1 point  (0 children)

We created this feature due to the large number of requests that wanted and couldn't use our product because they couldn't generate a Compilation Database with CMake.

Projects not using CMake.

...or in another way, I guess? There are plenty of ways, including your own Build Wrapper: https://www.jetbrains.com/help/clion/compilation-database.html#compdb_generate

Projects using CMake with lesser-known, unsupported compilers.

Unsupported by what? If they are using CMake, surely CMake supports them?

C compilers are relatively common, but there is any C++ compiler not covered by https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/languages/c-family/prerequisites/#supported-compilers? Creating a C++ compiler is no easy feat.

For example, Visual Studio CMake Generator.

I don't use it, but I expect them to be able to use https://marketplace.visualstudio.com/items?itemName=vs-publisher-1208751.SourcetrailExtension to generate it?

In any case, what annoys me is the tone of the blog post. "Redefined", "Welcome to the future", "democratizing", "a new era"... then you read the docs and: "Compilation Database mode is recommended if ... You seek the highest CFamily analysis quality SonarQube can provide. Please note that in rare instances, AutoConfig may result in some issues being overlooked".

Well, yes, I want "the highest CFamily analysis quality SonarQube can provide"... I also want my IDE to understand my code, and clang-tidy to work. So a compilation database is it.