I follow the document to configure to scan C/C++/Objective C:
Download build-wrapper-linux-x86 from host SonarQube
Unzip it
Them execute command: build-wrapper-linux-x86-64 --out-dir build_wrapper_output_directory make clean all. It response: make: *** No rule to make target ‘clean’. Stop.
I try: build-wrapper-linux-x86-64 --out-dir build_wrapper_output_directory make. But it still response: make: *** No targets specified and no makefile found. Stop.
Please, help me to fix it.
Does running make clean all without the build wrapper produce a successful build? How do you normally build your C/C++ code (what command do you run)? That’s the command you should use (make clean all is just an example of a build command, you should use your own)
I’m sorry but I don’t quite understand what you mean.
I try that command to export folder output with build_wapper.json and add it into sonar_project.properties. But it is unsuccess.
I don’t know if I did it right? Can you guide me how to do it.
And, I try to scan code application with flutter language.
Thank you
What is your procedure to build your C/C++/… project normally?
Do you have a bunch of unix-scripts that call the compiler directly, or do you perhaps use “make” and pass it a special makefile with option “-f” ?
The “make” in the description of the build-wrapper is not a “feature” of the buildwrapper, but should just serve as the example command to first clean everything, then build everything of the project.
If you have a completely special way of compiling, answer here… I might have some more tricks in my toolbox to share
Oh, my application coded with java language and flutter SDK.
But when I scan, it response have some file with C/C++/Objective C. And I work around with:
sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=-
sonar.objc.file.suffixes=-
in sonar-project.properties.
So,I find a way to scan for all, both java and C/C++/Objective C in my application.
With those properties, you essentially tell sonarqube to not treat any file as c/c++/objectiveC.
If you really do not want to scan these files, then all is fine, but your original question did not sound like that.
If you do have c/c++/objectiveC files and you want them scanned, then you went the wrong way with those properties.
If you want your c/c++/… files scanned, you need to tell sonarqube exactly how each single c/c++/objC source is compiled. If you can wrap your build-process with sonarqube, then sonarqube can find it out by itself. If you cannot go this way, you need at least a full log of every single compiler call.