-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.cmd
69 lines (50 loc) · 1.55 KB
/
build.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
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
@echo off
set _MsBuild=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe
set _CMake=C:\Program Files\CMake\bin\cmake.exe
call :_build vc142 x86 Release
call :_build vc142 x86 Debug
call :_build vc142 x64 Release
call :_build vc142 x64 Debug
call :_build vc141 x86 Release
call :_build vc141 x86 Debug
call :_build vc141 x64 Release
call :_build vc141 x64 Debug
call :_build vc140 x86 Release
call :_build vc140 x86 Debug
call :_build vc140 x64 Release
call :_build vc140 x64 Debug
call :_build vc120 x86 Release
call :_build vc120 x86 Debug
call :_build vc120 x64 Release
call :_build vc120 x64 Debug
echo Ok
goto :_end
:_build
set _Tool=%1
set _Arch=%2
set _Conf=%3
echo Toolset: %_Tool%
echo Architecture: %_Arch%
echo Configuration: %_Conf%
set _Dir=obj.%_Tool%.%_Arch%
echo Subdirectory: %_Dir%
if "%_Tool%"=="vc120" set _Gen=Visual Studio 12 2013
if "%_Tool%"=="vc140" set _Gen=Visual Studio 14 2015
if "%_Tool%"=="vc141" set _Gen=Visual Studio 15 2017
if "%_Tool%"=="vc142" set _Gen=Visual Studio 16 2019
if "%_Gen%"=="" echo Unknwon toolset&& exit /b 1
echo CMake generator: %_Gen%
if "%_Arch%"=="x86" set _GenArch=Win32
if "%_Arch%"=="x64" set _GenArch=x64
if "%_GenArch%"=="" echo Unknwon architecture&& exit /b 1
echo CMake architecture: %_GenArch%
if not exist "%_Dir%" mkdir "%_Dir%"
pushd "%_Dir%"
"%_CMake%" -G "%_Gen%" -A %_GenArch% ..
popd
if errorlevel 1 exit /b 1
pushd "%_Dir%"
"%_MsBuild%" /v:m /p:Configuration=%_Conf% utf-cpp.sln
if errorlevel 1 exit /b 1
popd
:_end