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:
Letting the executables inform clangmetatool of the 'main' function
that is used to detect the binary name, and we assume that a resource
directory exists relative to this (since clangmetatool_install ensures
this)
If the first step fails to locate an executable, then we attempt to
find the basename in $PATH
Additional context
Internally reported bugfix, current workaround is for tools to specificy -resource-dir or --gcc-toolchain as hints to find standard include dirs.
Internal ticket ID ENG2STAAR-1699
Describe your changes This change fixes the following bug in all tools built using
clangmetatool::ToolApplicationSupport
: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.