build-windows.bat 2.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. REM This script assumes the environment is already setup. For example:
  2. REM
  3. REM set PATH=C:\Python27;C:\Tools;C:\msys32\mingw32\bin;c:\msys32\usr\bin;C:\MinGW\msys\1.0\bin\;c:\windows\system32
  4. REM set CMAKE_DIR="c:\Program Files (x86)\CMake 3.2.3\bin"
  5. REM set QTROOT=c:\qt\qt5\build
  6. REM set EXTRADEPS=c:\whateveryouhave (see below)
  7. REM call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\vsvars32.bat"
  8. REM set BUILD_DIR=build
  9. REM (BUILD_DIR should be the name of the working dir - it must be a direct child directory of the repo dir)
  10. REM EXTRADEPS directory contents:
  11. REM - download libsdl.org/release/SDL2-devel-2.0.3-VC.zip
  12. REM - copy the include dir contents to EXTRADEPS/include
  13. REM - copy lib/x64/SDL2.{dll,lib} to EXTRADEPS/lib
  14. scripts\fetch-binaries.py -p windows-mingw32-x86_64 -n latest -d plexmediaplayer-windows-dependencies --nochecksha || exit /b
  15. scripts\fetch-binaries.py -p msvc-windows-i386 -n latest -d plexmediaplayer-dependencies-msvc --nochecksha || exit /b
  16. REM put all dependencies into a single dir
  17. rmdir /S /Q dependencies\all-deps
  18. mkdir dependencies\all-deps || exit /b
  19. robocopy dependencies\konvergo-depends-windows-mingw32-x86_64-release dependencies\all-deps * /e
  20. robocopy dependencies\konvergo-depends-msvc-windows-i386-release dependencies\all-deps * /e
  21. robocopy %EXTRADEPS% dependencies\all-deps * /e
  22. set DEPS=%cd%\dependencies\all-deps
  23. LIB /def:%DEPS%\bin\mpv-1.def /out:%DEPS%\lib\mpv.lib /MACHINE:X64 || exit /b
  24. cd %BUILD_DIR% || exit /b
  25. %CMAKE_DIR%\cmake -DCRASHDUMP_SECRET=%CD_SECRET% -DQTROOT=%QTROOT% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=output -DDEPENDENCY_ROOT=%DEPS% -DBREAKPAD_LIBRARY=%DEPS%\lib\breakpad.lib -DMPV_INCLUDE_DIR=%DEPS%\include -DMPV_LIBRARY=%DEPS%\lib\mpv.lib -DSDL2_LIBRARY=%DEPS%\lib\sdl2.lib -DSDL2_INCLUDE_DIR=%DEPS%\include -DCEC_LIBRARY=%DEPS%\lib\libcec.lib -DCEC_INCLUDE_DIR=%DEPS%\include .. -G Ninja -DCODE_SIGN=ON || exit /b
  26. ninja || exit /b
  27. ninja package || exit /b
  28. ..\scripts\WindowsSign.cmd PlexMediaPlayer-*.exe