tuliom wrote:

> `clang::Driver` has this method which allows you to specify the starting path 
> for the clang installation to use for the resource lookup.
> 
> ```c++
> /// Takes the path to a binary that's either in bin/ or lib/ and returns
> /// the path to clang's resource directory.
> static std::string GetResourcesPath(StringRef BinaryPath,
>                                     StringRef CustomResourceDir = "");
> ```

I don't think an implementation based on `GetResourcesPath()` will work outside 
of Clang.
In order for this function to return the correct PATH for all scenarios, we 
need that `CustomResourceDir=CLANG_RESOURCE_DIR`.
That forces us back to the original discussion about exporting 
`CLANG_RESOURCE_DIR`.

Here is an example on how this function is used in Clang:
https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/Driver.cpp#L242

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