History

DOCS/compile-windows.md: improve Windows build documentation

Currently the documentation for building on Windows, specifically the "Native Compilation with Clang (Windows SDK Build)" route, could use a few minor improvement to make the development onboarding experience more smoothly. Fixes #14214

Crend King committed 2 years ago

Commit d53aa6d1 parent 2becb971 file · +25 −8Browse files

Unified · Split

DOCS/compile-windows.md+25−8
@@ -144,7 +144,12 @@ they will be automatically downloaded and built by Meson. · 143 unmodified lines
144144 or the full [Visual Studio](https://visualstudio.microsoft.com/downloads/#visual-studio-community-2022):
145145 - From the installer, select the necessary components:
146146 - Clang compiler for Windows
147+ - C++ CMake tools for Windows
147148 - Windows SDK
149+ - Activate the developer shell:
150+ ```
151+ & "<Visual Studio Path>\Common7\Tools\Launch-VsDevShell.ps1" -Arch amd64 -HostArch amd64 -SkipAutomaticLocation | Out-Null
152+ ```
148153 2. Install Meson, as outlined in [Getting Meson](https://mesonbuild.com/Getting-meson.html):
149154 - **Important**: At the time of writing, there is an issue in Meson with
150155 escaping response files.
@@ -154,19 +159,31 @@ they will be automatically downloaded and built by Meson. · 3 unmodified lines
154159
155160 If you wish to install a fixed version, follow the steps outlined
156161 [here](https://github.com/mpv-player/mpv/blob/481e498427fc34956ad24b94157553908f5cd638/.github/workflows/build.yml#L132-L135).
157−3. Set environment variables or use the ``--native-file`` option in Meson.
162+3. The following build script utilizes the Meson subprojects system to build mpv and its dependencies.
163+ To make sure all dependency versions are up-to-date, update the subprojects database from Meson's WrapDB.
164+ Also explicitly download several wraps as some nested projects may pull older versions of them.
165+ ```
166+ meson wrap update-db
158167
159− ``` powershell
160− $env:CC = "clang"
161− $env:CXX = "clang++"
168+ meson wrap install expat
169+ meson wrap install harfbuzz
170+ meson wrap install libpng
171+ meson wrap install zlib
172+ ```
173+4. Set environment variables or use the `--native-file` option in Meson.
174+ ```powershell
175+ $env:CC = 'clang'
176+ $env:CXX = 'clang++'
162177 $env:CC_LD = 'lld'
163178 $env:CXX_LD = 'lld'
164179 $env:WINDRES = 'llvm-rc'
165180 ```
166−
167−4. Execute [build-win32.ps1](https://github.com/mpv-player/mpv/blob/master/ci/build-win32.ps1):
168− - This script utilizes the Meson subprojects system to build mpv and its
169− dependencies. Refer to the script for more details.
181+ Note that some dependencies (e.g. LuaJIT) may require `sed` to configure. Fortunately, it is already bundled in
182+ [Git for Windows](https://www.git-scm.com/download/win):
183+ ```powershell
184+ $env:PATH += ';<Git Path>\usr\bin'
185+ ```
186+5. Execute [ci\build-win32.ps1](https://github.com/mpv-player/mpv/blob/master/ci/build-win32.ps1). Refer to the script for more details.
170187
171188 This process will produce a fully static ``mpv.exe`` and ``mpv.com``, as well as
172189 a static ``libmpv.a``.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t