build-release.bat 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. @echo off
  2. setlocal
  3. pushd "%~dp0"
  4. if "%VCVARSALL%"=="" set "VCVARSALL=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat"
  5. if "%VCTOOLSET%"=="" set "VCTOOLSET=VC143"
  6. if not exist "%VCVARSALL%" (
  7. echo vcvarsall.bat not found, set VCVARSALL to its path
  8. exit /b 1
  9. )
  10. if "%1"=="" (
  11. echo No version specified, using current
  12. set "version=current"
  13. ) else (
  14. set "version=%1"
  15. )
  16. set "builddir=%~dp0\build\release-%version%"
  17. if exist "%builddir%" (
  18. echo Deleting contents of %builddir%
  19. rd /s /q "%builddir%"
  20. )
  21. cmake --preset win32 -B "%builddir%\build-win32"
  22. cmake --preset win32-omp -B "%builddir%\build-win32-omp"
  23. cmake --preset win64 -B "%builddir%\build-win64"
  24. cmake --preset win64-omp -B "%builddir%\build-win64-omp"
  25. cmake --build "%builddir%\build-win32" --config Release
  26. cmake --build "%builddir%\build-win32-omp" --config Release
  27. cmake --build "%builddir%\build-win64" --config Release
  28. cmake --build "%builddir%\build-win64-omp" --config Release
  29. mkdir "%builddir%\rel-win32\msdfgen"
  30. mkdir "%builddir%\rel-win32-omp\msdfgen"
  31. mkdir "%builddir%\rel-win64\msdfgen"
  32. mkdir "%builddir%\rel-win64-omp\msdfgen"
  33. copy "%builddir%\build-win32\Release\msdfgen.exe" "%builddir%\rel-win32\msdfgen"
  34. copy "%builddir%\build-win32-omp\Release\msdfgen.exe" "%builddir%\rel-win32-omp\msdfgen"
  35. copy "%builddir%\build-win64\Release\msdfgen.exe" "%builddir%\rel-win64\msdfgen"
  36. copy "%builddir%\build-win64-omp\Release\msdfgen.exe" "%builddir%\rel-win64-omp\msdfgen"
  37. 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"
  38. copy "%builddir%\example.bat" "%builddir%\rel-win32\msdfgen"
  39. copy "%builddir%\example.bat" "%builddir%\rel-win32-omp\msdfgen"
  40. copy "%builddir%\example.bat" "%builddir%\rel-win64\msdfgen"
  41. copy "%builddir%\example.bat" "%builddir%\rel-win64-omp\msdfgen"
  42. call "%VCVARSALL%" x64
  43. set "omp32dll=%VCToolsRedistDir%\x86\Microsoft.%VCTOOLSET%.OPENMP\vcomp140.dll"
  44. set "omp64dll=%VCToolsRedistDir%\x64\Microsoft.%VCTOOLSET%.OPENMP\vcomp140.dll"
  45. if not exist "%omp32dll%" (
  46. echo vcomp140.dll [x86] not found, make sure to set VCTOOLSET or update this script
  47. exit /b 1
  48. )
  49. if not exist "%omp64dll%" (
  50. echo vcomp140.dll [x64] not found, make sure to set VCTOOLSET or update this script
  51. exit /b 1
  52. )
  53. copy "%omp32dll%" "%builddir%\rel-win32-omp\msdfgen"
  54. copy "%omp64dll%" "%builddir%\rel-win64-omp\msdfgen"
  55. if not exist "C:\Program Files\7-Zip\7z.exe" (
  56. echo 7-Zip not found, you have to package it manually
  57. exit /b 0
  58. )
  59. pushd "%builddir%\rel-win32"
  60. "C:\Program Files\7-Zip\7z.exe" a "..\msdfgen-%version%-win32.zip" msdfgen
  61. cd msdfgen
  62. call example.bat
  63. popd
  64. pushd "%builddir%\rel-win32-omp"
  65. "C:\Program Files\7-Zip\7z.exe" a "..\msdfgen-%version%-win32-openmp.zip" msdfgen
  66. cd msdfgen
  67. call example.bat
  68. popd
  69. pushd "%builddir%\rel-win64"
  70. "C:\Program Files\7-Zip\7z.exe" a "..\msdfgen-%version%-win64.zip" msdfgen
  71. cd msdfgen
  72. call example.bat
  73. popd
  74. pushd "%builddir%\rel-win64-omp"
  75. "C:\Program Files\7-Zip\7z.exe" a "..\msdfgen-%version%-win64-openmp.zip" msdfgen
  76. cd msdfgen
  77. call example.bat
  78. popd
  79. popd