This repository has been archived by the owner on May 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
Windows MSVC dev setup
rakslice edited this page Jun 19, 2017
·
9 revisions
Unfortunately, there isn't a scripted Windows build environment setup at the moment.
But if you want to get it set up manually, here's what I'm using for 64-bit MSVC builds:
- Visual Studio Community 2015 - Offline ISO image w/ Update 3: https://go.microsoft.com/fwlink/?LinkId=615448&clcid=0x409
- Qt 5.8 prebuilt Open Source edition - offline installer (64-bit https://download.qt.io/official_releases/qt/5.8/5.8.0/qt-opensource-windows-x86-msvc2015_64-5.8.0.exe, 32-bit would be https://download.qt.io/official_releases/qt/5.8/5.8.0/qt-opensource-windows-x86-msvc2015-5.8.0.exe)
- Libmpv - grab a recent dev download from https://mpv.srsfckn.biz/ and extract it somewhere
- A .def file for Libmpv suitable for creating the .lib: The mpv.srsfckn.biz Windows builds don't include this, so you'll have to grab the corresponding file from the mpv source, e.g. https://github.com/mpv-player/mpv/blob/v0.25.0/libmpv/mpv.def from v0.25.0 is current; put it in your mpv dir and add a line
EXPORTS
at the top - An OpenSSL 1.0.x build from https://slproweb.com/products/Win32OpenSSL.html (64-bit light install https://slproweb.com/download/Win64OpenSSL_Light-1_0_2k.exe, 32-bit would be https://slproweb.com/download/Win32OpenSSL_Light-1_0_2k.exe)
When installing VS, you'll need to make sure to select these optional components:
- Programming Languages -> Visual C++
- Common Tools for Visual C++ 2015
- Windows XP Support for C++
When installing Qt, you'll need to make sure to select these optional components:
- Qt5.8
- msvc2015
My build script, named build.cmd
and dropped in the source dir (adjust the variables at the top for your paths):
set QTDIR=i:\qt\5.8\msvc2015_64
set MPVDIR=i:\mpv
set SSLDIR=c:\OpenSSL-Win64
rem The Microsoft SDKs are from the Visual Studio 2015 Community install (make sure Windows XP support for C++ is selected)
set SDKDIR=C:\Program Files (x86)\Microsoft SDKs
set WINKITSDIR=C:\Program Files (x86)\Windows Kits
set VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
set VCBINS=%VCINSTALLDIR%\bin\amd64
set PATH=%PATH%;%QTDIR%\bin;%VCBINS%;%SDKDIR%\Windows\v7.1A\Bin
set INCLUDE=%VCINSTALLDIR%\include;%SDKDIR%\Windows\v7.1A\Include;%WINKITSDIR%\10\Include\10.0.10150.0\ucrt;%MPVDIR%\include
set LIB=%QTDIR%\lib;%VCINSTALLDIR%\lib\amd64;%SDKDIR%\Windows\v7.1A\lib\x64;%WINKITSDIR%\10\Lib\10.0.10150.0\ucrt\x64;%MPVDIR%
set TARGET=%1
if "%1"=="" (
echo "specify release or debug"
exit /b
)
if exist %TARGET%\orion.exe erase %TARGET%\orion.exe
if not exist libs mkdir libs
copy /y "%MPVDIR%\mpv-1.dll" libs
copy /y "%SSLDIR%\libeay32.dll" libs
copy /y "%SSLDIR%\ssleay32.dll" libs
lib /def:%MPVDIR%\mpv.def /name:%MPVDIR%\mpv-1.dll /out:%MPVDIR%\mpv.lib /MACHINE:X64 || (pause; exit /b 1)
%QTDIR%\bin\qmake orion.pro
"%VCBINS%\nmake" %TARGET% || (pause; exit 1)
%QTDIR%\bin\windeployqt --qmldir src\qml %TARGET%\orion.exe
copy /y "libs\mpv-1.dll" %TARGET%
copy /y "libs\ssleay32.dll" %TARGET%
copy /y "libs\libeay32.dll" %TARGET%
My MSVC project settings:
Configuration All Configurations**, x64**:
- General -> Configuration Type: Makefile **
- NMake -> Include Search Path e.g.
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt
i:\qt\5.8\msvc2015_64\include\QtQml
i:\qt\5.8\msvc2015_64\include\QtQuick
i:\qt\5.8\msvc2015_64\include\QtGui
i:\qt\5.8\msvc2015_64\include\QtNetwork
i:\qt\5.8\msvc2015_64\include\QtWidgets
i:\qt\5.8\msvc2015_64\include\QtCore
i:\qt\5.8\msvc2015_64\include\QtWebEngine
i:\qt\5.8\msvc2015_64\include
i:\mpv\include
For Configuration Debug:
- NMake -> Build Command Line
build.cmd debug
- NMake -> Rebuild Command Line
build.cmd debug
For Configuration Release:
- NMake -> Build Command Line
build.cmd release
- NMake -> Rebuild Command Line
build.cmd release
(**You'll need to save and reopen the project config dialog after these changes to see the right sections & fields)