1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-13 10:26:09 +00:00
mpv/DOCS/build-system-differences.md
Dudemanguy 9db818279a test: integrate unittests with meson
This reworks all of mpv's unit tests so they are compiled as separate
executables (optional) and run via meson test. Because most of the tests
are dependant on mpv's internals, existing compiled objects are
leveraged to create static libs and used when necessary. As an aside, a
function was moved into video/out/gpu/utils for sanity's sake (otherwise
most of vo would have been needed). As a plus, meson multithreads
running tests automatically and also the output no longer pollutes the
source directory. There are tests that can break due to ffmpeg changes,
so they require a specific minimum libavutil version to be built.
2023-03-02 15:45:27 +00:00

2.7 KiB

Differences Between Meson and Waf

mpv currently supports two different build systems: waf and meson. In general, option names between both build systems are mostly the same. In most cases, --enable-foo in waf becomes -Dfoo=enabled in meson. Likewise, --disable-foo becomes -Dfoo=disabled. For the rest of this document, Waf options will be noted as --foo while meson options are noted as foo.

Universal Options

Meson has several universal options that you get for free. In some cases, these overlapped with custom waf options.

  • --libmpv-static and --libmpv-shared were combined into one option: libmpv. Use default_library to control if you want to build static or shared libraries.
  • Waf had a boolean --optimize option. In meson, this is a universal option, optimization, which can take several different values. In mpv's meson build, the default is 2.
  • Instead of --debug-build, meson simply calls it debug. It is enabled by default.

Changed Options

  • The legacy lua names (52, 52deb, etc.) for --lua are not supported in the meson build. Instead, pass the generic pkg-config values such as lua52, lua5.2, etc.
  • --lgpl was changed to gpl. If gpl is false, the build is LGPL2.1+.
  • --tests was removed since unit tests now explictly require meson to run

Boolean Options

The following options are all booleans that accept true or false instead of enabled or disabled.

  • build-date
  • cplayer
  • gpl
  • libmpv
  • ta-leak-report
  • tests

Removed Options

There are options removed with no equivalent in the meson build.

  • --asm was removed since it doesn't do anything.
  • --android was removed since meson knows if the machine is android.
  • --clang-compilation-database was removed. Meson can do this on its own by invoking ninja (ninja -t compdb).
  • --tvos was removed since it doesn't do anything.
  • --static-build was removed. Use default_library.
  • --swift-static was removed. The swift library always dynamically links.

Renamed Options

These are some other options that were renamed.

  • --gl-wayland was renamed to egl-wayland.
  • --swift was renamed to swift-build.

Other

  • The meson build supports passing the SOURCE_DATE_EPOCH environment variable during the compilation step for those who want reproducibility without having to disable the build date.
  • The Configuration line shown by mpv -v does not show everything passed on cli since meson does not have any easy way to access a user's argv. Instead, it simply shows whatever the value of prefix is regardless if it was specified or not.