pytorch3d/packaging/vs2019/activate.bat
facebook-github-bot dbf06b504b Initial commit
fbshipit-source-id: ad58e416e3ceeca85fae0583308968d04e78fe0d
2020-01-23 11:53:46 -08:00

46 lines
1.2 KiB
Batchfile

:: Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
:: Set env vars that tell distutils to use the compiler that we put on path
SET DISTUTILS_USE_SDK=1
SET MSSdk=1
SET "VS_VERSION=16.0"
SET "VS_MAJOR=16"
SET "VS_YEAR=2019"
set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out"
set "MSYS2_ENV_CONV_EXCL=CL"
:: For Python 3.5+, ensure that we link with the dynamic runtime. See
:: http://stevedower.id.au/blog/building-for-python-3-5-part-two/ for more info
set "PY_VCRUNTIME_REDIST=%PREFIX%\\bin\\vcruntime140.dll"
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -legacy -products * -version [16^,17^) -property installationPath`) do (
if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" (
set "VSINSTALLDIR=%%i\"
goto :vswhere
)
)
:vswhere
:: Shorten PATH to avoid the `input line too long` error.
SET MyPath=%PATH%
setlocal EnableDelayedExpansion
SET TempPath="%MyPath:;=";"%"
SET var=
FOR %%a IN (%TempPath%) DO (
IF EXIST %%~sa (
SET "var=!var!;%%~sa"
)
)
set "TempPath=!var:~1!"
endlocal & set "PATH=%TempPath%"
:: Shorten current directory too
FOR %%A IN (.) DO CD "%%~sA"
:: other things added by install_activate.bat at package build time