bloomberg / clangmetatool

A framework for reusing code in Clang tools
https://bloomberg.github.io/clangmetatool/
Apache License 2.0
119 stars 25 forks source link

Infer resource dir from tool executable path #48

Closed envp closed 4 years ago

envp commented 4 years ago

Internal ticket ID ENG2STAAR-1699

Describe your changes This change fixes the following bug in all tools built using clangmetatool::ToolApplicationSupport:

If the compiler appearing the compilation database is not clang or doesn't have an installation of clangmetatool at a predefined location, we would need to provide -resource-dir as an extra argument to allow it to detect where standard C/C++ headers such as stdarg.h, stddef.h, or iostream lived.

Tools built, and installed using clangmetatool will now be able to infer the location of clang's bundled standard includes automatically, if they are conventionally installed with clangmetatool_install(...). This change will continue to support passing -resource-dir to override this automatic detection.

This is enabled by:

Signed-off-by: Vaibhav Yenamandra vyenamandra@bloomberg.net

Testing performed

Additional context Internally reported bugfix, current workaround is for tools to specificy -resource-dir or --gcc-toolchain as hints to find standard include dirs.

envp commented 4 years ago

cc: @dbeer1 @HaltCatchFire

dbeer1 commented 4 years ago

CI seems to fail