mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 15:52:25 +00:00
7e2edad8ef
This commit adds a new build system based on waf. configure and Makefile are deprecated effective immediately and someday in the future they will be removed (they are still available by running ./old-configure). You can find how the choice for waf came to be in `DOCS/waf-buildsystem.rst`. TL;DR: we couldn't get the same level of abstraction and customization with other build systems we tried (CMake and autotools). For guidance on how to build the software now, take a look at README.md and the cross compilation guide. CREDITS: This is a squash of ~250 commits. Some of them are not by me, so here is the deserved attribution: - @wm4 contributed some Windows fixes, renamed configure to old-configure and contributed to the bootstrap script. Also, GNU/Linux testing. - @lachs0r contributed some Windows fixes and the bootstrap script. - @Nikoli contributed a lot of testing and discovered many bugs. - @CrimsonVoid contributed changes to the bootstrap script.
53 lines
1.7 KiB
Plaintext
53 lines
1.7 KiB
Plaintext
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:
|
||
DEST_OS=win32 TARGET=i686-w64-mingw32 ./waf configure
|
||
|
||
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
|
||
|
||
Warning: the original MinGW (http://www.mingw.org) is unsupported.
|
||
|
||
Note that MinGW environments included in Linux distributions are often broken,
|
||
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
|
||
# or more!
|
||
|
||
cd /opt
|
||
git clone https://github.com/mxe/mxe
|
||
cd mingw
|
||
|
||
# Edit the MXE target, so that MinGW-w64 for 32 bit targets is built.
|
||
|
||
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
|
||
DEST_OS=win32 TARGET=i686-w64-mingw32 ./waf configure
|
||
./waf build
|
||
|
||
# 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.
|