forked from meta-pytorch/torchcodec
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvc_env_helper.bat
More file actions
51 lines (40 loc) · 1.27 KB
/
Copy pathvc_env_helper.bat
File metadata and controls
51 lines (40 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
:: Copyright (c) Meta Platforms, Inc. and affiliates.
:: All rights reserved.
::
:: This source code is licensed under the BSD-style license found in the
:: LICENSE file in the root directory of this source tree.
:: Taken from torchaudio
@echo on
set VC_VERSION_LOWER=17
set VC_VERSION_UPPER=18
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -legacy -products * -version [%VC_VERSION_LOWER%^,%VC_VERSION_UPPER%^) -property installationPath`) do (
if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" (
set "VS15INSTALLDIR=%%i"
set "VS15VCVARSALL=%%i\VC\Auxiliary\Build\vcvarsall.bat"
goto vswhere
)
)
:vswhere
if "%VSDEVCMD_ARGS%" == "" (
call "%VS15VCVARSALL%" x64 || exit /b 1
) else (
call "%VS15VCVARSALL%" x64 %VSDEVCMD_ARGS% || exit /b 1
)
@echo on
if "%CU_VERSION%" == "xpu" call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
set DISTUTILS_USE_SDK=1
set BUILD_AGAINST_ALL_FFMPEG_FROM_S3=1
if "%CU_VERSION:~0,2%" == "cu" set ENABLE_CUDA=1
set args=%1
shift
:start
if [%1] == [] goto done
set args=%args% %1
shift
goto start
:done
if "%args%" == "" (
echo Usage: vc_env_helper.bat [command] [args]
echo e.g. vc_env_helper.bat cl /c test.cpp
)
%args% || exit /b 1