-
-
Notifications
You must be signed in to change notification settings - Fork 415
/
build-release.bat
96 lines (79 loc) · 3.17 KB
/
build-release.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
91
92
93
94
95
96
@echo off
setlocal
pushd "%~dp0"
if "%VCVARSALL%"=="" set "VCVARSALL=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat"
if "%VCTOOLSET%"=="" set "VCTOOLSET=VC143"
if not exist "%VCVARSALL%" (
echo vcvarsall.bat not found, set VCVARSALL to its path
exit /b 1
)
if "%1"=="" (
echo No version specified, using current
set "version=current"
) else (
set "version=%1"
)
set "builddir=%~dp0\build\release-%version%"
if exist "%builddir%" (
echo Deleting contents of %builddir%
rd /s /q "%builddir%"
)
cmake --preset win32 -B "%builddir%\build-win32"
cmake --preset win32-omp -B "%builddir%\build-win32-omp"
cmake --preset win64 -B "%builddir%\build-win64"
cmake --preset win64-omp -B "%builddir%\build-win64-omp"
cmake --build "%builddir%\build-win32" --config Release
cmake --build "%builddir%\build-win32-omp" --config Release
cmake --build "%builddir%\build-win64" --config Release
cmake --build "%builddir%\build-win64-omp" --config Release
mkdir "%builddir%\rel-win32\msdfgen"
mkdir "%builddir%\rel-win32-omp\msdfgen"
mkdir "%builddir%\rel-win64\msdfgen"
mkdir "%builddir%\rel-win64-omp\msdfgen"
copy "%builddir%\build-win32\Release\msdfgen.exe" "%builddir%\rel-win32\msdfgen"
copy "%builddir%\build-win32-omp\Release\msdfgen.exe" "%builddir%\rel-win32-omp\msdfgen"
copy "%builddir%\build-win64\Release\msdfgen.exe" "%builddir%\rel-win64\msdfgen"
copy "%builddir%\build-win64-omp\Release\msdfgen.exe" "%builddir%\rel-win64-omp\msdfgen"
echo msdfgen.exe -defineshape "{ 1471,0; 1149,0; 1021,333; 435,333; 314,0; 0,0; 571,1466; 884,1466; # }{ 926,580; 724,1124; 526,580; # }" -size 16 16 -autoframe -testrender render.png 1024 1024 > "%builddir%\example.bat"
copy "%builddir%\example.bat" "%builddir%\rel-win32\msdfgen"
copy "%builddir%\example.bat" "%builddir%\rel-win32-omp\msdfgen"
copy "%builddir%\example.bat" "%builddir%\rel-win64\msdfgen"
copy "%builddir%\example.bat" "%builddir%\rel-win64-omp\msdfgen"
call "%VCVARSALL%" x64
set "omp32dll=%VCToolsRedistDir%\x86\Microsoft.%VCTOOLSET%.OPENMP\vcomp140.dll"
set "omp64dll=%VCToolsRedistDir%\x64\Microsoft.%VCTOOLSET%.OPENMP\vcomp140.dll"
if not exist "%omp32dll%" (
echo vcomp140.dll [x86] not found, make sure to set VCTOOLSET or update this script
exit /b 1
)
if not exist "%omp64dll%" (
echo vcomp140.dll [x64] not found, make sure to set VCTOOLSET or update this script
exit /b 1
)
copy "%omp32dll%" "%builddir%\rel-win32-omp\msdfgen"
copy "%omp64dll%" "%builddir%\rel-win64-omp\msdfgen"
if not exist "C:\Program Files\7-Zip\7z.exe" (
echo 7-Zip not found, you have to package it manually
exit /b 0
)
pushd "%builddir%\rel-win32"
"C:\Program Files\7-Zip\7z.exe" a "..\msdfgen-%version%-win32.zip" msdfgen
cd msdfgen
call example.bat
popd
pushd "%builddir%\rel-win32-omp"
"C:\Program Files\7-Zip\7z.exe" a "..\msdfgen-%version%-win32-openmp.zip" msdfgen
cd msdfgen
call example.bat
popd
pushd "%builddir%\rel-win64"
"C:\Program Files\7-Zip\7z.exe" a "..\msdfgen-%version%-win64.zip" msdfgen
cd msdfgen
call example.bat
popd
pushd "%builddir%\rel-win64-omp"
"C:\Program Files\7-Zip\7z.exe" a "..\msdfgen-%version%-win64-openmp.zip" msdfgen
cd msdfgen
call example.bat
popd
popd