zufuliu / llvm-utils

LLVM/Clang toolsets for Visual Studio 2022, 2019, 2017, 2015, 2013, 2012 and 2010.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[enhancement] Support for Developer Command Prompt / vcvarsall possible?

HealsCodes opened this issue · comments

Hi,
would it be possible to add the required scripts to make the LLVM v14* toolchains available in the Developer Command Prompt?

The toolchain files you provide work amazingly well with MSBuild targets, but it would be awesome if we could also use them from within a terminal so they get picked up by CMake / Ninja as is currently possible by using helpers like vcvarsall.bat

See issue #2 on how to use these toolchains in CMake.

for ninja, you will need to override CC and CXX with path to clang-cl.exe, e.g.

set PATH=D:/Dev/LLVM/bin;%PATH%
set CC=D:/Dev/LLVM/bin/clang-cl.exe
set CXX=D:/Dev/LLVM/bin/clang-cl.exe

cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release 

for ninja, you will need to override CC and CXX with path to clang-cl.exe, e.g.

set PATH=D:/Dev/LLVM/bin;%PATH%
set CC=D:/Dev/LLVM/bin/clang-cl.exe
set CXX=D:/Dev/LLVM/bin/clang-cl.exe

cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release 

Oh wow.. I feel a bit dumb now for not thinking about pointing CMake / Ninja at clang-cl.exe.
I was used to having to resort to vcvarsall.bat in a terminal in order to get CMake to pick up the regular cl.exe at all but this just works out of the box by telling CMake where to look for clang-cl - thanks a lot!