I am building an open-source project with Travis and followed the guides to also scan it with SonarCloud.
The project is written in C++ and CMake.
There are basically two variants of the software, that are chose by a CMake define (cmake -D…).
Depending on this define, different Source Files are build.
What I managed to do is to run two jobs in Travis consecutively (one for each variant) and wrap the build with the sonar scanner.
In the Travis logs both variants complete and it seems both sonar results are uploaded.
However, in the Sonar Project I do only see results (bugs, smells, etc.) for the second variant, the code of the first seems not to be checked.
Is it the correct approach to analyze such a project structure?
Or do I need to analyze both variants within one build?
That would not make any sense from functional point of view, but I could manage to do so using wrappers/mocks, etc.
Infos: