forked from CharlesShang/DCNv2
-
Notifications
You must be signed in to change notification settings - Fork 5
/
make_develop.bat
90 lines (90 loc) · 3.56 KB
/
make_develop.bat
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
:: Updated by rathaROG on July 03, 2024
@ECHO OFF
SETLOCAL enabledelayedexpansion
ECHO =============================================================================
ECHO = Build in develop mode for debugging or creating 3rd party library =
ECHO =============================================================================
ECHO.
SET "vs_root_dir=C:\Program Files (x86)\Microsoft Visual Studio\"
SET "vc_dir=NAN"
SET "year=NAN"
SET "edition=NAN"
IF EXIST "C:\Program Files\Microsoft Visual Studio\" (
SET "vs_root_dir=C:\Program Files\Microsoft Visual Studio\"
)
IF NOT EXIST "%vs_root_dir%" (
ECHO Could not find your Microsoft Visual Studio!
ECHO.
GOTO MNSETVS
) ELSE (
IF EXIST "%vs_root_dir%2017\" SET "year=2017"
IF EXIST "%vs_root_dir%2019\" SET "year=2019"
IF EXIST "%vs_root_dir%2022\" SET "year=2022"
IF EXIST "%vs_root_dir%2024\" SET "year=2024"
)
SET "year=!year!"
IF "%year%" EQU NAN (
ECHO Could not find your Microsoft Visual Studio!
ECHO.
GOTO MNSETVS
) ELSE (
IF EXIST "%vs_root_dir%%year%\Community\" SET "edition=Community"
IF EXIST "%vs_root_dir%%year%\Professional\" SET "edition=Professional"
IF EXIST "%vs_root_dir%%year%\Enterprise\" SET "edition=Enterprise"
)
SET "edition=!edition!"
SET "vc_dir=%vs_root_dir%%year%\%edition%\VC\Auxiliary\Build\"
IF NOT EXIST "%vc_dir%" (
ECHO -----------------------------------------------------------------------------
ECHO Could not find Microsoft Visual Studio C++ compiler!
ECHO Now let's set it manually!
ECHO -----------------------------------------------------------------------------
GOTO MNSETVS
) ELSE (
ECHO -----------------------------------------------------------------------------
ECHO Found Microsoft Visual Studio C++ compiler:
ECHO Microsoft Visual Studio %year% %edition% %processor_architecture%
ECHO -----------------------------------------------------------------------------
GOTO BUIDNOW
)
:MNSETVS
ECHO Manually set your VS C++ compiler:
:SETVS
ECHO.
ECHO Set ROOT=YOUR_PATH\Microsoft Visual Studio
ECHO Or press 'Enter' to set ROOT=C:\Program Files (x86)\Microsoft Visual Studio\
SET /P "vs_root_dir=ROOT=" || SET "vs_root_dir=C:\Program Files (x86)\Microsoft Visual Studio\"
IF NOT "%vs_root_dir:~-1%"=="\" SET "vs_root_dir=%vs_root_dir%\"
ECHO.
ECHO Set YEAR=2017 or YEAR=2019 or YEAR=2022
ECHO Or press 'Enter' to set YEAR=2019
SET /P "year=YEAR=" || SET "year=2019"
ECHO.
ECHO Set EDITION=Community, or EDITION=Professional, or EDITION=Enterprise
ECHO Or press 'Enter' to set EDITION=Enterprise
SET /P "edition=EDITION=" || SET "edition=Enterprise"
ECHO.
SET "vc_dir=%vs_root_dir%%year%\%edition%\VC\Auxiliary\Build\"
IF NOT EXIST "%vc_dir%" (
ECHO -----------------------------------------------------------------------------
ECHO Could not find Microsoft Visual Studio C++ compiler!
ECHO Let's try again!
ECHO -----------------------------------------------------------------------------
GOTO SETVS
) ELSE (
ECHO -----------------------------------------------------------------------------
ECHO Found Microsoft Visual Studio C++ compiler:
ECHO Microsoft Visual Studio %year% %edition% %processor_architecture%
ECHO -----------------------------------------------------------------------------
GOTO BUIDNOW
)
:BUIDNOW
ECHO.
SET "DISTUTILS_USE_SDK=1"
IF /I "%processor_architecture%"=="AMD64" CALL "%vc_dir%vcvars64.bat" >NUL
IF /I "%processor_architecture%"=="x86" CALL "%vc_dir%vcvars32.bat" >NUL
ECHO DCNv2 '_ext' will be built after you press any key
PAUSE
ECHO.
python setup.py build develop
PAUSE