2013-01-08 16:11:59 +00:00
|
|
|
|
Cross compiling mpv to Windows is supported with MinGW-w64. This can be used to
|
|
|
|
|
produce both 32 bit and 64 bit executables. MinGW-w64 is available from
|
|
|
|
|
http://mingw-w64.sourceforge.net.
|
|
|
|
|
|
|
|
|
|
You have to run mpv's configure with these arguments:
|
2013-07-16 11:28:28 +00:00
|
|
|
|
DEST_OS=win32 TARGET=i686-w64-mingw32 ./waf configure
|
2013-01-08 16:11:59 +00:00
|
|
|
|
|
2013-09-08 10:25:20 +00:00
|
|
|
|
Using mingw-w64-cmake to setup a MinGW-w64 environment is recommended (this will
|
|
|
|
|
also build mpv and its dependencies): https://github.com/lachs0r/mingw-w64-cmake
|
|
|
|
|
|
|
|
|
|
Alternatively, use MXE: http://mxe.cc
|
2013-01-08 16:11:59 +00:00
|
|
|
|
|
|
|
|
|
Warning: the original MinGW (http://www.mingw.org) is unsupported.
|
|
|
|
|
|
2013-07-30 14:07:42 +00:00
|
|
|
|
Note that MinGW environments included in Linux distributions are often broken,
|
2013-01-08 16:11:59 +00:00
|
|
|
|
outdated and useless, and usually don't use MinGW-w64.
|
|
|
|
|
|
|
|
|
|
Example with MXE
|
|
|
|
|
================
|
|
|
|
|
|
|
|
|
|
# Download MXE. Note that compiling the required packages requires about 1 GB
|
2013-09-08 10:25:20 +00:00
|
|
|
|
# or more!
|
2013-01-08 16:11:59 +00:00
|
|
|
|
|
|
|
|
|
cd /opt
|
2013-12-19 20:29:21 +00:00
|
|
|
|
git clone https://github.com/mxe/mxe mingw
|
2013-01-08 16:11:59 +00:00
|
|
|
|
cd mingw
|
|
|
|
|
|
2013-07-30 14:07:42 +00:00
|
|
|
|
# Edit the MXE target, so that MinGW-w64 for 32 bit targets is built.
|
2013-01-08 16:11:59 +00:00
|
|
|
|
|
|
|
|
|
echo "MXE_TARGETS := i686-w64-mingw32" > settings.mk
|
|
|
|
|
|
|
|
|
|
# Build required packages. The following provide a minimum required to build
|
|
|
|
|
# mpv. (Not all of the following packages are strictly required.)
|
|
|
|
|
|
|
|
|
|
make gcc
|
|
|
|
|
make ffmpeg
|
|
|
|
|
make libass
|
|
|
|
|
make jpeg
|
|
|
|
|
make pthreads
|
|
|
|
|
|
|
|
|
|
# Build mpv. The target will be used to automatically select the name of the
|
|
|
|
|
# build tools involved (e.g. it will use i686-w64-mingw32-gcc).
|
|
|
|
|
|
|
|
|
|
git clone https://github.com/mpv-player/mpv.git
|
|
|
|
|
cd mpv
|
|
|
|
|
export PATH=/opt/mingw/usr/bin/:$PATH
|
2013-07-16 11:28:28 +00:00
|
|
|
|
DEST_OS=win32 TARGET=i686-w64-mingw32 ./waf configure
|
|
|
|
|
./waf build
|
2013-01-08 16:11:59 +00:00
|
|
|
|
|
2013-09-08 10:25:20 +00:00
|
|
|
|
# This should work. Note however that MXE’s ffmpeg package might be very old
|
|
|
|
|
# in order to avoid breaking e.g. xine-lib, so you might want to update that
|
|
|
|
|
# or build it manually as well.
|