Open 11philip22 opened 3 years ago
How about remove above property?
LLVMInstallDir
is detected from registry (which is set official installer from https://github.com/llvm/llvm-project/releases), see https://github.com/zufuliu/llvm-utils/blob/main/VS2017/LLVM/LLVM.Common.props#L3
<PropertyGroup>
<LLVMInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM)</LLVMInstallDir>
<LLVMInstallDir Condition="'$(LLVMInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM)</LLVMInstallDir>
for your self built llvm, two workarounds:
you set ClangClExecutable
in your project:
create registry and set default value for LLVM\LLVM
item to the directory C:\llvm
.
I will need time to figure out why override LLVMInstallDir
not work, and expose it in LLVM property page for easy configuration.
Hi @11philip22, can you test latest code, check whether it works now?
In 319852e44ab5a6bf03873e565bff54444984f1a8, I changed LLVMInstallDir
to only use official installation folder when bin\clang-cl.exe
exists (in your case, since bin\clang-cl.exe
is not found, it's an empty string).
By default Visual Studio 2019/2022 sets LLVMInstallDir
to $(VsInstallRoot)\VC\Tools\Llvm
or $(VsInstallRoot)\VC\Tools\Llvm\x64
, depends on the imported order of your Directory.build.props
file, this change may still not fix the problem.
How about remove above property?
LLVMInstallDir
is detected from registry (which is set official installer from https://github.com/llvm/llvm-project/releases), see https://github.com/zufuliu/llvm-utils/blob/main/VS2017/LLVM/LLVM.Common.props#L3<PropertyGroup> <LLVMInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM)</LLVMInstallDir> <LLVMInstallDir Condition="'$(LLVMInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM)</LLVMInstallDir>
for your self built llvm, two workarounds:
1. you set `ClangClExecutable` in your project: ![ClangClExecutable](https://user-images.githubusercontent.com/2289926/138464602-aba182c7-70b8-4e7d-8346-388b436ac1d6.png) 2. create registry and set default value for `LLVM\LLVM` item to the directory `C:\llvm`.
I will need time to figure out why override
LLVMInstallDir
not work, and expose it in LLVM property page for easy configuration.
hi @zufuliu Thanks for responding.
I dont think LLVMInstallDir
is set because i compiled from source.
Hi @11philip22, can you test latest code, check whether it works now?
In 319852e, I changed
LLVMInstallDir
to only use official installation folder whenbin\clang-cl.exe
exists (in your case, sincebin\clang-cl.exe
is not found, it's an empty string). By default Visual Studio 2019/2022 setsLLVMInstallDir
to$(VsInstallRoot)\VC\Tools\Llvm
or$(VsInstallRoot)\VC\Tools\Llvm\x64
, depends on the imported order of yourDirectory.build.props
file, this change may still not fix the problem.
I will try out your new release :)
Hi, I have installed llvm-utils for visual studio 2019. And i have installed llvm in
C:\llvm
But when i compile a project withLLVM v 142
as toolchain. i get the errorThe specified task executable location "bin\clang-cl.exe" is invalid.
I have aDirectory.build.props
in my project root with the following contents: