clang-tutor
clang-tutor copied to clipboard
How to compile with these clang tools?
Thank you very much for this anazing project. I've successfully run all the examples. But I still have some confusion. How should I use these tools to compile a real project?
For example, I want to use libCodeStyleChecker.so
into a real compilation process of a large project. Normally, I can do this by modifying the system environment variable CC
, such as:
CC="clang -cc1 -load /path/to/libCodeStyleChecker.so -plugin CSC " make
But I can't get any output files. Further more, I made the following attempt:
clang -cc1 -fcolor-diagnostics -load ./libCodeStyleChecker.so -plugin CSC ../../test/CodeStyleCheckerFunction.cpp -o test.o
../../test/CodeStyleCheckerFunction.cpp:6:6: warning: Function names should start with lower-case letter
void ClangTutorFuncBad();
^~
clangTutorFuncBad
../../test/CodeStyleCheckerFunction.cpp:12:8: warning: Function names should start with lower-case letter
void ClangTutorMemberMethodBad();
^~
clangTutorMemberMethodBad
2 warnings generated.
I got the following result:
# xxx @ XXX in ~/Workspace/Testspace/clang-ast/clang-tutor/build/lib on git:main x 15:51:11
$ ls
CMakeFiles libCodeRefactor.so libHelloWorld.so libObfuscator.so Makefile
cmake_install.cmake libCodeStyleChecker.so libLACommenter.so libUnusedForLoopVar.so
As we can see that the -o
option I entered did not work, and I couldn't compile any cpp
files.
Please tell me what should I do to be able to compile a large project while using clang plugins
?