-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake.bat
More file actions
65 lines (48 loc) · 1.3 KB
/
make.bat
File metadata and controls
65 lines (48 loc) · 1.3 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
IF "%1" == "libOpenCOR" (
SET Mode=%1
) ELSE IF "%1" == "OpenCOR" (
SET Mode=%1
) ELSE IF NOT "%1" == "" (
ECHO Usage: %0 [libOpenCOR^|OpenCOR]
EXIT /B 1
)
FOR %%X IN (ninja.exe) DO (
SET NinjaFound=%%~$PATH:X
)
IF DEFINED NinjaFound (
SET Generator=Ninja
) ELSE (
SET Generator=JOM
)
TITLE Making the general documentation for [lib]OpenCOR (using !Generator!)...
IF NOT DEFINED NinjaFound (
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" (
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
) ELSE (
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
)
)
CD build
IF DEFINED NinjaFound (
SET CMakeGenerator=Ninja
) ELSE (
SET CMakeGenerator=NMake Makefiles
)
cmake -G "!CMakeGenerator!" -DMODE=!Mode! -DENABLE_DOWNLOADS=ON ..
SET ExitCode=!ERRORLEVEL!
IF !ExitCode! EQU 0 (
FOR /F "TOKENS=1,* DELIMS= " %%X IN ("%*") DO (
SET Args=%%Y
)
IF DEFINED NinjaFound (
ninja !Args!
SET ExitCode=!ERRORLEVEL!
) ELSE (
nmake /f Makefile !Args!
SET ExitCode=!ERRORLEVEL!
)
)
CD ..
EXIT /B !ExitCode!