-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmake.cmd
41 lines (34 loc) · 896 Bytes
/
make.cmd
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
@echo off
REM %1 is visual studio version (2019 or 2022)
REM %2 is configuration (Release or Debug)
REM %3 is platform (x86 or x64)
REM Validating input
IF "%~1" == "2019" (
SET VISUAL_STUDIO="Visual Studio 16 2019"
) ELSE (
IF "%~1" == "2022" (
SET VISUAL_STUDIO="Visual Studio 17 2022"
) ELSE (
GOTO Error
)
)
IF "%~2" NEQ "Release" (
IF "%~2" NEQ "Debug" (
GOTO Error
)
)
IF "%~3" NEQ "x64" (
IF "%~3" NEQ "Win32" (
GOTO Error
)
)
cmake -S src -B build/%1%3 -G %VISUAL_STUDIO% -A %3
if %errorlevel% NEQ 0 exit /b 1
msbuild build/%1%3/excelbind.sln /t:Rebuild /p:Configuration=%2 /p:Platform=%3
if %errorlevel% NEQ 0 exit /b 1
GOTO EOF
:Error
echo "Calling convention is 'make compilerVersion configuration platform'"
echo "Where compilerVersion in [2019, 2022], configuration in [Release, Debug] and platform in [Win32, x64]"
exit /b 1
:EOF