KyleMayes / clang-sys

Rust bindings for libclang.
Apache License 2.0
128 stars 65 forks source link

Detect LLVM installation directory in visual studio on Windows #166

Closed ikey4u closed 1 month ago

ikey4u commented 6 months ago

Hi! As @perqin mentioned here https://github.com/KyleMayes/clang-sys/issues/121, visual studio does install Llvm into directory like

C:\Program Files*\Microsoft Visual Studio\*\VC\Tools\Llvm

And this path is mentioned in visual studio document here:

It links with the Microsoft implementation of the Standard Library. By default, clang-cl.exe is located in %VCINSTALLDIR%\Tools\Llvm\bin\ and %VCINSTALLDIR%\Tools\Llvm\x64\bin.

If you think it's alright, I would be happy to submit a patch and assist with related testing.

KyleMayes commented 1 month ago

I've released v1.8.1 which removed BuildTools from the search path for Visual Studio (see above referenced commit), so it should be better at detecting libclang in this case.