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


whereas the includes are in


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:

If unset, the driver computes the path:

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.