Scan monorepo with C++ (CMake) and C# code

We are using SonarCloud to scan our monorepo, consisting of a mixed language environment:

  • C++ code, compiled using CMake
  • Rust code
  • C# (CMake generated project files)

The sonar scan is executed on our Jenkins build nodes, using the regular sonar scanner. We are not using the wrapper, but leverage the CMake compile database.

C# scanning doesn’t work in that setup, we need to use the Sonar Scanner for .NET of course. While we can do that (using the CMake generated project files), we are trying to find a way to merge the scanner results with those generated by the regular scanner.

Any advise?

Hey there.

Is your C# code typically compiled directly alongside your C++ code (using MSBuild or something else to orchestrate both), or completely seperately?

If completely seperately, I would reccomend using two seperate SonarCloud projects defined as a monorepo in SonarCloud.