Make Clang environment for Windows

As with GCC on Windows it’s often useful to have separate development environments for each compiler. The Powershell script “~/clang.ps1” creates a Clang LLVM environment. We don’t permanently put Clang on our user or system PATH. Running “~/clang.ps1” in Powershell enables Clang until that Powershell window is closed.

$Env:CC="clang"
$Env:FC="flang"
$Env:CXX="clang++"
$Env:path += ";C:/Program Files/LLVM/bin"

If you need to use the MSVC CL-like clang driver clang-cl, create “~/clang-cl.ps1” and run it when desired.

$Env:CC="clang-cl"
$Env:FC="flang"
$Env:CXX="clang-cl"
$Env:path += ";C:/Program Files/LLVM/bin"