Coder Social home page Coder Social logo

Comments (8)

zufuliu avatar zufuliu commented on June 11, 2024

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>

UseClangCl

from llvm-utils.

zufuliu avatar zufuliu commented on June 11, 2024

for BuildTools, can you test whether following script works or not? it's based on microsoft/vswhere#22 (comment)

@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
)

from llvm-utils.

nolange avatar nolange commented on June 11, 2024

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

from llvm-utils.

nolange avatar nolange commented on June 11, 2024

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>

UseClangCl

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?

from llvm-utils.

zufuliu avatar zufuliu commented on June 11, 2024

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
)

from llvm-utils.

nolange avatar nolange commented on June 11, 2024

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
)

from llvm-utils.

zufuliu avatar zufuliu commented on June 11, 2024

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 59932b8.

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).

from llvm-utils.

nolange avatar nolange commented on June 11, 2024

Thanks

from llvm-utils.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.