Closed nolange closed 3 years ago
lld-link, llvm-lib and llvm-rc can be enabled by change following properties to true:
in LLVM.Common.props or generated project file.
<UseClangCl>true</UseClangCl>
<UseLldLink>false</UseLldLink>
<UseLlvmLib>false</UseLlvmLib>
<UseLlvmRc>false</UseLlvmRc>
for BuildTools, can you test whether following script works or not? it's based on https://github.com/Microsoft/vswhere/issues/22#issuecomment-283774339
@rem Visual Studio 2019 Build Tools
FOR /f "delims=" %%A IN ('"%VSWHERE%" -products "Microsoft.VisualStudio.Product.BuildTools" -property installationPath -prerelease -version [16.0^,17.0^)') DO (
SET VCT_PATH=%%A\MSBuild\Microsoft\VC\v160\Platforms
IF EXIST "!VCT_PATH!" CALL :SUB_VS2019 "!VCT_PATH!"
@rem Visual C++ 2017 v141 toolset
SET VCT_PATH=%%A\MSBuild\Microsoft\VC\v150\Platforms
IF EXIST "!VCT_PATH!" CALL :SUB_VS2017 "!VCT_PATH!" 2019
)
its very strange, the tool would output the right string, but the script will complain that 'C:\Program' is not recognized as an internal or external command, operable program or batch file.
It does work as intended if I remove the quotes around Microsoft.VisualStudio.Product.BuildTools
H:\>"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -products "Microsoft.VisualStudio.Product.BuildTools" -property installationPath -prerelease -version [16.0^,17.0^)
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
lld-link, llvm-lib and llvm-rc can be enabled by change following properties to true:
in LLVM.Common.props or generated project file.
<UseClangCl>true</UseClangCl> <UseLldLink>false</UseLldLink> <UseLlvmLib>false</UseLlvmLib> <UseLlvmRc>false</UseLlvmRc>
Ok, so i need to either do that globally or use a GUI that I dont have? Probably A missing feature in CMake to be able to set target props?
its very strange, the tool would output the right string, but the script will complain that
'C:\Program' is not recognized as an internal or external command, operable program or batch file.
It does work as intended if I remove the quotes around
Microsoft.VisualStudio.Product.BuildTools
H:\>"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -products "Microsoft.VisualStudio.Product.BuildTools" -property installationPath -prerelease -version [16.0^,17.0^) C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
Thanks for the testing, I means add the script into https://github.com/zufuliu/llvm-utils/blob/master/VS2017/install.bat#L24 (before IF %SUCCESS% == 0
)
@rem Visual Studio 2019 Build Tools
FOR /f "delims=" %%A IN ('"%VSWHERE%" -products "Microsoft.VisualStudio.Product.BuildTools" -property installationPath -prerelease -version [16.0^,17.0^)') DO (
SET VCT_PATH=%%A\MSBuild\Microsoft\VC\v160\Platforms
IF EXIST "!VCT_PATH!" CALL :SUB_VS2019 "!VCT_PATH!"
@rem Visual C++ 2017 v141 toolset
SET VCT_PATH=%%A\MSBuild\Microsoft\VC\v150\Platforms
IF EXIST "!VCT_PATH!" CALL :SUB_VS2017 "!VCT_PATH!" 2019
)
Yes i did that. But it only works if I remove the quotes, maybe the CMD processor dies something stupid like matching the last double quote? You should get the same error msg
@rem Visual Studio 2019 Build Tools
FOR /f "delims=" %%A IN ('"%VSWHERE%" -products Microsoft.VisualStudio.Product.BuildTools -property installationPath -prerelease -version [16.0^,17.0^)') DO (
SET VCT_PATH=%%A\MSBuild\Microsoft\VC\v160\Platforms
IF EXIST "!VCT_PATH!" CALL :SUB_VS2019 "!VCT_PATH!"
@rem Visual C++ 2017 v141 toolset
SET VCT_PATH=%%A\MSBuild\Microsoft\VC\v150\Platforms
IF EXIST "!VCT_PATH!" CALL :SUB_VS2017 "!VCT_PATH!" 2019
)
Tested other product ids from https://docs.microsoft.com/en-us/visualstudio/install/workload-and-component-ids, without quotes indeed works, committed changes to install.bat as 59932b80d2306199bdefd52b641c251603589bdd.
For CMake, you can changed LLVM.Common.props locally, and test whether lld-link, llvm-lib and llvm-rc works for you projects. unlike clang-cl, these tools are not very compatible with corresponding msvc tools, or not works as expected (e.g. LTO with MSBuild VC project not works).
Thanks
Hello,
I would like to use LLVM without the Visual Studio IDE (either cmdline or other editors). They tend to be hard to find, but the toolset is available standalone Visual Studio 2019 Build Tools.
What I effectively had to do was replace the detection in the install script with:
this lets me use CMake for Projects by using
PS. is it possible to pass target properties to CMake ? like using ldd-link and llvm-rc?