diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5822e4851a..8c5ff67993 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -387,7 +387,7 @@ jobs: - name: Build with meson id: build run: | - ./ci/build-linux-old.sh + ./ci/build-linux-old.sh - name: Print meson log if: ${{ failure() && steps.build.outcome == 'failure' }} diff --git a/ci/build-common.sh b/ci/build-common.sh new file mode 100755 index 0000000000..1d1a0debad --- /dev/null +++ b/ci/build-common.sh @@ -0,0 +1,6 @@ +common_args="--werror \ +-Dlibmpv=true \ +-Dtests=true \ +" + +export CFLAGS="$CFLAGS -Wno-error=deprecated -Wno-error=deprecated-declarations" diff --git a/ci/build-freebsd.sh b/ci/build-freebsd.sh index e272ef6774..b2cb774313 100755 --- a/ci/build-freebsd.sh +++ b/ci/build-freebsd.sh @@ -1,29 +1,27 @@ #!/bin/sh set -e -export CFLAGS="$CFLAGS -isystem/usr/local/include" +. ./ci/build-common.sh + +export CFLAGS="$CFLAGS -isystem/usr/local/include -march=native" export CXXFLAGS="$CXXFLAGS -isystem/usr/local/include" export LDFLAGS="$LDFLAGS -L/usr/local/lib" # TODO: readd -Ddvbin=enabled -meson setup build \ - --werror \ - -Dc_args="-Wno-error=deprecated -Wno-error=deprecated-declarations -march=native" \ - -Diconv=disabled \ - -Dlibmpv=true \ - -Dlua=enabled \ - -Degl-drm=enabled \ - -Dopenal=enabled \ - -Dsndio=enabled \ - -Dtests=true \ - -Dvdpau=enabled \ - -Dvulkan=enabled \ - -Doss-audio=enabled \ - $(pkg info -q libdvdnav && echo -Ddvdnav=enabled) \ - $(pkg info -q libcdio-paranoia && echo -Dcdda=enabled) \ - $(pkg info -q pipewire && echo -Dpipewire=enabled) \ - $NULL +meson setup build $common_args \ + -Db_sanitize=address,undefined \ + -Diconv=disabled \ + -Dlua=enabled \ + -Degl-drm=enabled \ + -Dopenal=enabled \ + -Dsndio=enabled \ + -Dvdpau=enabled \ + -Dvulkan=enabled \ + -Doss-audio=enabled \ + $(pkg info -q libdvdnav && echo -Ddvdnav=enabled) \ + $(pkg info -q libcdio-paranoia && echo -Dcdda=enabled) \ + $(pkg info -q pipewire && echo -Dpipewire=enabled) meson compile -C build ./build/mpv -v --no-config diff --git a/ci/build-linux-old.sh b/ci/build-linux-old.sh index 29499f1f24..456a6442bc 100755 --- a/ci/build-linux-old.sh +++ b/ci/build-linux-old.sh @@ -1,6 +1,8 @@ #!/bin/sh set -e +. ./ci/build-common.sh + # clone exactly the oldest libplacebo we want to support rm -rf subprojects mkdir -p subprojects @@ -8,12 +10,8 @@ git clone https://code.videolan.org/videolan/libplacebo.git \ --recurse-submodules --shallow-submodules \ --depth=1 --branch v6.338 subprojects/libplacebo \ -meson setup build \ - --werror \ - -Dlibplacebo:vulkan=disabled \ - -Dlibmpv=true \ - -Dlua=enabled \ - -Dtests=true - +meson setup build $common_args \ + -Dlibplacebo:vulkan=disabled \ + -Dlua=enabled meson compile -C build ./build/mpv -v --no-config diff --git a/ci/build-macos.sh b/ci/build-macos.sh index d11befa13a..c30fe95b7c 100755 --- a/ci/build-macos.sh +++ b/ci/build-macos.sh @@ -2,6 +2,8 @@ set -e +. ./ci/build-common.sh + FFMPEG_SYSROOT="${HOME}/deps/sysroot" MPV_INSTALL_PREFIX="${HOME}/out/mpv" MPV_VARIANT="${TRAVIS_OS_NAME}" @@ -11,14 +13,12 @@ if [[ -d "./build/${MPV_VARIANT}" ]] ; then fi PKG_CONFIG_PATH="${FFMPEG_SYSROOT}/lib/pkgconfig/" CC="${CC}" CXX="${CXX}" \ -meson setup build \ - --werror \ - -Dprefix="${MPV_INSTALL_PREFIX}" \ - -D{c_args,objc_args}="-Wno-error=deprecated -Wno-error=deprecated-declarations" \ - -D{libmpv,tests}=true \ - -D{gl,iconv,lcms2,lua,jpeg,plain-gl,zlib}=enabled \ - -D{cocoa,coreaudio,gl-cocoa,videotoolbox-gl,videotoolbox-pl}=enabled \ - -D{swift-build,macos-cocoa-cb,macos-media-player,macos-touchbar,vulkan}=enabled +meson setup build $common_args \ + -Dprefix="${MPV_INSTALL_PREFIX}" \ + -Dobjc_args="-Wno-error=deprecated -Wno-error=deprecated-declarations" \ + -D{gl,iconv,lcms2,lua,jpeg,plain-gl,zlib}=enabled \ + -D{cocoa,coreaudio,gl-cocoa,videotoolbox-gl,videotoolbox-pl}=enabled \ + -D{swift-build,macos-cocoa-cb,macos-media-player,macos-touchbar,vulkan}=enabled meson compile -C build -j4 meson install -C build diff --git a/ci/build-mingw64.sh b/ci/build-mingw64.sh index e837cdcec2..0f3d93350c 100755 --- a/ci/build-mingw64.sh +++ b/ci/build-mingw64.sh @@ -23,6 +23,8 @@ export LDFLAGS="-fstack-protector-strong" export PKG_CONFIG_SYSROOT_DIR="$prefix_dir" export PKG_CONFIG_LIBDIR="$PKG_CONFIG_SYSROOT_DIR/lib/pkgconfig" +. ./ci/build-common.sh + if [[ "$TARGET" == "i686-"* ]]; then export WINEPATH="`$CC -print-file-name=`;/usr/$TARGET/lib" fi @@ -294,16 +296,13 @@ export CFLAGS LDFLAGS build=mingw_build rm -rf $build -meson setup $build --cross-file "$prefix_dir/crossfile" \ - --werror \ - -Dc_args="-Wno-error=deprecated -Wno-error=deprecated-declarations" \ - --buildtype debugoptimized \ - --force-fallback-for=mujs \ - -Dmujs:werror=false \ - -Dmujs:default_library=static \ - -D{libmpv,tests}=true -Dlua=luajit \ - -D{shaderc,spirv-cross,d3d11,javascript}=enabled - +meson setup $build --cross-file "$prefix_dir/crossfile" $common_args \ + --buildtype debugoptimized \ + --force-fallback-for=mujs \ + -Dmujs:werror=false \ + -Dmujs:default_library=static \ + -Dlua=luajit \ + -D{shaderc,spirv-cross,d3d11,javascript}=enabled meson compile -C $build if [ "$2" = pack ]; then diff --git a/ci/build-msys2.sh b/ci/build-msys2.sh index c5a7da2800..cdfa8877dd 100755 --- a/ci/build-msys2.sh +++ b/ci/build-msys2.sh @@ -1,17 +1,16 @@ -#!/bin/sh -e +#!/bin/bash -e + +. ./ci/build-common.sh args=( - --werror - -Dc_args='-Wno-error=deprecated -Wno-error=deprecated-declarations' -D{cdda,d3d-hwaccel,d3d11,dvdnav,jpeg,lcms2,libarchive}=enabled -D{libbluray,lua,shaderc,spirv-cross,uchardet,vapoursynth}=enabled - -D{libmpv,tests}=true ) [[ "$SYS" != "mingw32" ]] && args+=( -D{egl-angle-lib,egl-angle-win32,pdf-build,rubberband,win32-smtc}=enabled ) -meson setup build "${args[@]}" +meson setup build $common_args "${args[@]}" meson compile -C build ./build/mpv.com -v --no-config diff --git a/ci/build-openbsd.sh b/ci/build-openbsd.sh index 26550a7bdc..2c9533b5fc 100755 --- a/ci/build-openbsd.sh +++ b/ci/build-openbsd.sh @@ -1,6 +1,8 @@ #!/bin/sh set -e +. ./ci/build-common.sh + # FFmpeg on openBSD (4.4.4) is too old; use a subproject rm -rf subprojects mkdir -p subprojects @@ -19,16 +21,14 @@ libswresample = libswresample_dep libswscale = libswscale_dep EOF -meson setup build \ - -Dffmpeg:vulkan=auto \ - -Dlibmpv=true \ - -Dlua=enabled \ - -Dopenal=enabled \ - -Dpulse=enabled \ - -Dtests=true \ - -Dvulkan=enabled \ - -Ddvdnav=enabled \ - -Dcdda=enabled - +meson setup build $common_args \ + -Dffmpeg:vulkan=auto \ + -Dffmpeg:werror=false \ + -Dlua=enabled \ + -Dopenal=enabled \ + -Dpulse=enabled \ + -Dvulkan=enabled \ + -Ddvdnav=enabled \ + -Dcdda=enabled meson compile -C build ./build/mpv -v --no-config diff --git a/ci/build-tumbleweed.sh b/ci/build-tumbleweed.sh index 069372a21c..72e8dbd66e 100755 --- a/ci/build-tumbleweed.sh +++ b/ci/build-tumbleweed.sh @@ -1,18 +1,16 @@ #!/bin/sh set -e -meson setup build \ - --werror \ - -Dc_args="-Wno-error=deprecated -Wno-error=deprecated-declarations" \ +. ./ci/build-common.sh + +meson setup build $common_args \ -Db_sanitize=address,undefined \ - -Dcdda=enabled \ - -Ddvbin=enabled \ - -Ddvdnav=enabled \ - -Dlibarchive=enabled \ - -Dlibmpv=true \ + -Dcdda=enabled \ + -Ddvbin=enabled \ + -Ddvdnav=enabled \ + -Dlibarchive=enabled \ -Dmanpage-build=enabled \ - -Dpipewire=enabled \ - -Dtests=true \ + -Dpipewire=enabled \ -Dvulkan=enabled meson compile -C build ./build/mpv -v --no-config