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.
2.7 KiB
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-staticand--libmpv-sharedwere combined into one option:libmpv. Usedefault_libraryto control if you want to build static or shared libraries.- Waf had a boolean
--optimizeoption. In meson, this is a universal option,optimization, which can take several different values. In mpv's meson build, the default is2. - Instead of
--debug-build, meson simply calls itdebug. It is enabled by default.
Changed Options
- The legacy lua names (
52,52deb, etc.) for--luaare not supported in the meson build. Instead, pass the generic pkg-config values such aslua52,lua5.2, etc. --lgplwas changed togpl. Ifgplis false, the build is LGPL2.1+.--testswas 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-datecplayergpllibmpvta-leak-reporttests
Removed Options
There are options removed with no equivalent in the meson build.
--asmwas removed since it doesn't do anything.--androidwas removed since meson knows if the machine is android.--clang-compilation-databasewas removed. Meson can do this on its own by invoking ninja (ninja -t compdb).--tvoswas removed since it doesn't do anything.--static-buildwas removed. Usedefault_library.--swift-staticwas removed. The swift library always dynamically links.
Renamed Options
These are some other options that were renamed.
--gl-waylandwas renamed toegl-wayland.--swiftwas renamed toswift-build.
Other
- The meson build supports passing the
SOURCE_DATE_EPOCHenvironment variable during the compilation step for those who want reproducibility without having to disable the build date. - The
Configurationline shown bympv -vdoes 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 ofprefixis regardless if it was specified or not.