Open
Description
I am using libclang to parse C source files. Given a small program like:
#include <stddef.h>
int main(void)
{
size_t hello = 5;
return hello;
}
libclang should report fatal error: 'stddef.h' file not found
.
On my system (Fedora 36), the resource directory is located:
$ clang -print-resource-dir
/usr/lib64/clang/14.0.5
Which means the include directory is located at $(clang -print-resource-dir)/include)
. The clang cmake modules already expose a variable called CLANG_INCLUDE_DIRS
, but the only directory exposed in this variable is $CMAKE_INSTALL_PREFIX/include
, which isn't helpful for what I need.
Ideally these constants would be exposed in a cross buildsystem way like #9777, but I am willing to settle for just appending to the CLANG_INCLUDE_DIRS
array since that should be as little effort as possible to solve what I need.