Created
January 30, 2021 00:36
-
-
Save nico/0be25ae4dd0b6ed2ab3c3a797920a0eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ech off | |
REM Creates "myroot" which can be used with `clang-cl /winsysroot myroot` | |
setlocal | |
REM Adjust this one accordingly: | |
set VSInstallDir="%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Professional" | |
set WinSdkDir="%ProgramFiles(x86)%\Windows Kits" | |
mkdir "myroot\Windows Kits" | |
mklink /j myroot\VC %VSInstallDir%\VC | |
mklink /j "myroot\Windows Kits\10" %WinSdkDir%\10 | |
endlocal | |
REM The correct value of VSInstallDir can be found programmatically by running | |
REM | |
REM vswhere -latest -products * -requires $ID -property installationPath | |
REM | |
REM where ID=Microsoft.VisualStudio.Component.VC.Tools.x86.x64 and where vswhere | |
REM is at "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere", | |
REM but calling that in bat is so ungainly and hard to read that I'm hardcoding | |
REM the path instead. If you're curious, the almost-full invocation is at | |
REM https://github.com/microsoft/vswhere/wiki/Find-VC (except they assume | |
REM that vswhere is on PATH, which it isn't), but be warned: It's ugly. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment