0

I know SourceManager can give us the file name. Assuming, I have a CMake based project having subprojects, and the checker is invoked using

scan-build --use-analyzer=clang -enable-checker debug.SomeCustomChecker make

I am wondering whether I can get the name of the target for which the checker is being called right now. And if possible the name of the project as well. The most I am able to get so far is the file name (SourceManager::getFilename), but not the target or the project.

Thank You

Community
  • 1
  • 1
Nishant Sharma
  • 683
  • 9
  • 16
  • I heard about some preprocessor macro called `__FILE__` which contains the name of the translation unit. Would this help? – Thomas Matthews Jun 14 '16 at 20:01
  • I have tried using that, It ends up giving me the name of my checker's source file. Whereas the SourceManager API I have mentioned actually gives the name of the file being compiled. I want the name of the executable that will be generated after compiling the said file. – Nishant Sharma Jun 14 '16 at 20:06

0 Answers0