Clang to find its own headers

On Posix Clang expects the internal include files to be present relative to the binary: ../lib/clang/<version>/include. Where "<version>" is the version of Clang. Not sure if the same is true on Windows.

It might be true. clang.exe resides in

<vcpkg_root>/installed//tools/llvm/

whereas the includes are in

<vcpkg_root>/installed//lib/clang//include

so the way to reach them is …/…/lib/clang//include

Can I change this with configuring Clang? I don’t see any CMake param to LLVM that would controll this. Is this hardcoded? Where must I patch it?

Feladó: Kim Gräsman via cfe-dev [via Clang Developers]
Elküldve: 2019. január 10., csütörtök 11:58
Címzett: Meteorhead
Tárgy: Re: Clang to find its own headers

The CMake variable is called CLANG_RESOURCE_DIR, defined here:

https://github.com/llvm-mirror/clang/blob/master/CMakeLists.txt#L217

If unset, the driver computes the path:

https://github.com/llvm-mirror/clang/blob/master/lib/Driver/Driver.cpp#L121

If it’s possible to change the distribution, I would suggest keeping the directory structure that clang expects, though.
This would allow to be consistent with how other distributions (Chromium’s clang, LLVM releases) do that, allowing to swap clang compiled for those when needed.