kimgr wrote:

> Or making CustomResourceDir = CLANG_RESOURCE_DIR by default instead of "".

Binding that default value in Driver.h would leave it to external projects 
(using Clang) to resolve `CLANG_RESOURCE_DIR`, which is not available outside 
Clang. So it somehow needs to move into the body of `GetResourcesPath`.

Also, looking at the use of `CustomResourceDir`, it looks like it expects path 
relative to `dirname(clang)`, i.e. it would have to be something like ` 
`BinaryPath="/usr/lib/llvm-20/bin/clang"` and 
`{CLANG_RESOURCE_DIR,CustomResourceDir}="../share/my-tool/"`. Overall 
`CLANG_RESOURCE_DIR` and that custom resource dir seems pretty hard to get 
right, I wonder if it's ever used.

It was originally added to the LLVM CMake in 
https://github.com/llvm/llvm-project/commit/ffae4a66fa9de885382c48c725b1039593975986
 and used in the subsequent 
https://github.com/llvm/llvm-project/commit/06067c556a0beb136bf3bb62f478269f67701486.
 I'm curious about these 'strange packaging environments" :)

https://github.com/llvm/llvm-project/pull/97197
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to